
-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);

-- ----------------------------------------------------------------------------------------------------
-- force free client=10277 with redbean
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(10277,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 06:45:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:15:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:15:55', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 06:46:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:16:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:16:37', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 06:49:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:19:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:19:55', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729d46578663
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 10:16:37', '06729d46578663', '1', '0.00', '0', '0', '1', '165.00', '165', '165', '0', '1', '2024-11-05 10:19:55', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','165','0','','0','0','165','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143175', '0', '2024-11-05 10:19:55', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '165', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 10:16:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28732;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','05582', '143175', '5', '12148', '1', '165', '165', '0', '', '1', '2024-11-05 10:19:55', '12148', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28732-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 259.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 259.00
        
                where sellbilldetailid = 523349;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12148, '2024-11-05', 165, 260, 260
                    , 259, 260, 259, 259.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+259
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+259
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+259.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 260, 260
                    , 259, 260, 259, 259.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+259
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+259
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+259.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-05 10:19:55' WHERE storedetailid = '12147';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12148', '1', '1', '1', '143175', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '9', '2024-11-05 10:19:55','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '165',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('0','165', '0', '1', 'اضافة فاتورة مبيعات', '143175', '165', '2024-11-05 10:19:55', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 165, 260, 260
                    , 259, 260, 259, 259.44
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+259
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+259
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+259.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 260, 260
                    , 259, 260, 259, 259.44
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+259
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+259
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+259.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 165, 260, 260
                    , 259, 260, 259, 259.44, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+165, netSellCostBuyPrice = netSellCostBuyPrice+260
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+259
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+260
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+259
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+259.44
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729d46578663 and sellbillId = 143175 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 06:49:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:19:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:19:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE programsettings SET companyname = 'BRAVO STORE', address = '8 شارع بورسعيد امام مستشفى السيد جلال', specializtion = 'Shoes ', phone = '01000464376', faxnumber = '0502232923', email = 'mrabozied@gt4it.com', website = 'www.gt4host.com', logo = '7e5a967475936eb131e45001c916f002.jpg', roundnumbers = '0', saveprinting = '0', deptprinting = '0', printingpapersize = '0', userid = '1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '1',clientsearchvalue = '3', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = '0', taxcard = '332', commercialregistration = '3213123312', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '0', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2024-11-04',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='7d1e8143a130fbea73dd3b9428a2caad8616ba42c98c2ee7a1bee8768760601b26945ac68358157bd4fc715be3f2049d90617f7a25078b4fb12d780f17ff8d26',allowdateedit = '1', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='1' , date='1' , limitamount = '1' , measuringunit = '1' , print_amount = '0' , billid = '0' , precentages = '1' , realprice = '1' ,delegate_seller = '0' , storeserial = '1' ,clientfieldrequired ='0' , clientcodname='0' , colortype = '0' , nakdyOnly = '0' , nakdyKashf = '0' , discount_pres_direct = '0' , general_discount = '0' , sells_return = '0' ,scunitname ='0',vatValue = '0.00',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '1', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='first',Profitevaluation='first' , delivery='-2',premiums = '0',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',-2,-1,1,',earlyrepayment = '0',visaPay = '0',headerPrint='',headerPrintSand='',printSand='0',makeDailyEntry='0',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='1',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='1',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='1',printfoot='',sellorder='1',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='1',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='1',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='2',dailyEntryCostprice='first',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='9c2d4cf4cf5d4e24d5070164705832c3a5d1287f641a2960e48e04ae57a2ad0a5441322ca7cf34efd63003fdb348adbd0b61197c7c87d8dd5bc298c352482bc6',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='2' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 06:51:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:21:50", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 10:21:50', '77', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE programsettings SET companyname = 'BRAVO STORE', address = '8 شارع بورسعيد امام مستشفى السيد جلال', specializtion = 'Shoes ', phone = '01000464376', faxnumber = '0502232923', email = 'mrabozied@gt4it.com', website = 'www.gt4host.com', logo = '7e5a967475936eb131e45001c916f002.jpg', roundnumbers = '0', saveprinting = '0', deptprinting = '0', printingpapersize = '0', userid = '1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '1',clientsearchvalue = '3', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = '0', taxcard = '332', commercialregistration = '3213123312', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '0', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2024-11-05',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='7d1e8143a130fbea73dd3b9428a2caad8616ba42c98c2ee7a1bee8768760601b26945ac68358157bd4fc715be3f2049d90617f7a25078b4fb12d780f17ff8d26',allowdateedit = '1', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='1' , date='1' , limitamount = '1' , measuringunit = '1' , print_amount = '0' , billid = '0' , precentages = '1' , realprice = '1' ,delegate_seller = '0' , storeserial = '1' ,clientfieldrequired ='0' , clientcodname='0' , colortype = '0' , nakdyOnly = '0' , nakdyKashf = '0' , discount_pres_direct = '0' , general_discount = '0' , sells_return = '0' ,scunitname ='0',vatValue = '0.00',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '1', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='first',Profitevaluation='first' , delivery='-2',premiums = '0',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',-2,-1,1,',earlyrepayment = '0',visaPay = '0',headerPrint='',headerPrintSand='',printSand='0',makeDailyEntry='0',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='1',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='1',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='1',printfoot='',sellorder='1',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='1',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='1',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='2',dailyEntryCostprice='first',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='9c2d4cf4cf5d4e24d5070164705832c3a5d1287f641a2960e48e04ae57a2ad0a5441322ca7cf34efd63003fdb348adbd0b61197c7c87d8dd5bc298c352482bc6',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='2' WHERE programsettingsid = '1';
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 06:51:54";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:00:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:30:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:30:14', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:01:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:31:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:31:23', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729d7963a771
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 10:30:14', '06729d7963a771', '1', '0.00', '0', '10', '1', '300.00', '290', '290', '0', '1', '2024-11-05 10:31:23', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','290','0','','0','0','290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143176', '0', '2024-11-05 10:31:23', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '290', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 10:30:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34774;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R3248', '143176', '1', '15660', '1', '300', '300', '0', '', '1', '2024-11-05 10:31:23', '15660', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34774-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523350;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15660, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 10:31:23' WHERE storedetailid = '15659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15660', '1', '1', '1', '143176', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 10:31:23','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '455',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('165','290', '0', '1', 'اضافة فاتورة مبيعات', '143176', '455', '2024-11-05 10:31:23', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 290, 240, 240
                    , 240, 240, 240, 240, 240, 240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+290, netSellCostBuyPrice = netSellCostBuyPrice+240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729d7963a771 and sellbillId = 143176 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:01:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:31:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:31:24', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:03:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:33:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:33:00', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:03:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:33:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:33:52', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729d83ce2944
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 10:33:00', '06729d83ce2944', '1', '0.00', '0', '0', '1', '285', '285', '-285', '0', '1', '2024-11-05 10:33:52', '', '9', '0', 'نقدي','1', '0', '5', '6', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-285','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16226', '0', '2024-11-05 10:33:52', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '285', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 10:33:00','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('235.00', '06750', '16226', '5', '15315', '1', '285', '285', '0', '', '1', '0', '15315', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','285','285','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where returnsellbilldetailid = 21264;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15315, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 285, 235, 235, 235
                    , 235, 235, 235, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+285, returnSellCostBuyPrice = returnSellCostBuyPrice+235, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+235
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+235, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+235
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+235
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+235
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 285, 235, 235, 235
                    , 235, 235, 235, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+285, returnSellCostBuyPrice = returnSellCostBuyPrice+235, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+235
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+235, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+235
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+235
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+235
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 10:33:52' WHERE storedetailid = '15314';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15315', '1', '1', '0', '16226', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '-1', '0', '9', '2024-11-05 10:33:52','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '170',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('455','-285', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16226', '170', '2024-11-05 10:33:52', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 285, 235, 235, 235
                    , 235, 235, 235 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+285, returnSellCostBuyPrice = returnSellCostBuyPrice+235, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+235
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+235, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+235
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+235
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+235
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 285, 235, 235, 235
                    , 235, 235, 235 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+285, returnSellCostBuyPrice = returnSellCostBuyPrice+235, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+235
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+235, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+235
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+235
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+235
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -285, -235, -235
                    , -235, -235, -235, -235, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-285, netSellCostBuyPrice = netSellCostBuyPrice+-235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-235
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-235
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-235
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-235
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-235
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729d83ce2944 and sellbillId = 16226 and returnsellbillId = 16226
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:03:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:33:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:33:53', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:04:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:34:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:34:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:28:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:58:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:58:06', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729d87d1d9ac
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 10:34:05', '06729d87d1d9ac', '1', '0.00', '0', '0', '1', '350.00', '350', '350', '0', '1', '2024-11-05 10:58:07', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','350','0','','0','0','350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143177', '0', '2024-11-05 10:58:07', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '350', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 10:34:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34771;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06925', '143177', '5', '15785', '1', '350', '350', '0', '', '1', '2024-11-05 10:58:07', '15785', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34771-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 523351;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15785, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '9', storedetaildate = '2024-11-05 10:58:07' WHERE storedetailid = '15784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15785', '1', '1', '1', '143177', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '9', '2024-11-05 10:58:07','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '520',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('170','350', '0', '1', 'اضافة فاتورة مبيعات', '143177', '520', '2024-11-05 10:58:07', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 350, 280, 280
                    , 275, 280, 275, 270, 280, 270)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+350, netSellCostBuyPrice = netSellCostBuyPrice+280
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+280
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+275
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+280
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+275
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+270
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+280
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+270;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729d87d1d9ac and sellbillId = 143177 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:28:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 10:58:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 10:58:07', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:30:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:00:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:00:56', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729de1fe4032
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 10:58:07', '06729de1fe4032', '1', '0.00', '0', '0', '1', '785.00', '785', '785', '0', '1', '2024-11-05 11:00:56', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','785','0','','0','0','785','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143178', '0', '2024-11-05 11:00:56', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '785', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 10:58:07','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27511;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','05622', '143178', '5', '12263', '1', '220', '220', '0', '', '1', '2024-11-05 11:00:56', '12263', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27511-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 1684.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 1684.00
        
                where sellbilldetailid = 523352;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12263, '2024-11-05', 220, 300, 300
                    , 1684, 300, 1684, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1684
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1684
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 300, 300
                    , 1684, 300, 1684, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1684
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1684
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 11:00:56' WHERE storedetailid = '12262';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12263', '1', '1', '1', '143178', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 11:00:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30776;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06124', '143178', '5', '13857', '1', '190', '190', '0', '', '1', '2024-11-05 11:00:56', '13857', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30776-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        
                where sellbilldetailid = 523353;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13857, '2024-11-05', 190, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 11:00:56' WHERE storedetailid = '13856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13857', '1', '1', '1', '143178', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 11:00:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31283;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('215','0K716', '143178', '7', '14085', '1', '245', '245', '0', '', '1', '2024-11-05 11:00:56', '14085', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31283-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 215.00 , meanbuyprice = 215.00, lastbuyprice_withDiscount = 215.00, meanbuyprice_withDiscount = 215.00
        
                where sellbilldetailid = 523354;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14085, '2024-11-05', 245, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 245, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 11:00:56' WHERE storedetailid = '14084';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14085', '1', '1', '1', '143178', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 11:00:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31604;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100','06253', '143178', '5', '14213', '1', '130', '130', '0', '', '1', '2024-11-05 11:00:56', '14213', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31604-1,','1','1','0','0','130','130','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 122.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 122.00
        
                where sellbilldetailid = 523355;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14213, '2024-11-05', 130, 100, 100
                    , 122, 100, 122, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+130, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+122
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+122
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 130, 100, 100
                    , 122, 100, 122, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+130, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+122
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+122
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 11:00:56' WHERE storedetailid = '14212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14213', '1', '1', '1', '143178', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 11:00:56','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1305',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('520','785', '0', '1', 'اضافة فاتورة مبيعات', '143178', '1305', '2024-11-05 11:00:56', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 785, 790, 790
                    , 2196, 790, 2196, 790
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+785, sellCostBuyPrice =sellCostBuyPrice+790
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+790, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2196
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+790, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2196
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+790
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 785, 790, 790
                    , 2196, 790, 2196, 790
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+785, sellCostBuyPrice =sellCostBuyPrice+790
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+790, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2196
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+790, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2196
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+790
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 785, 790, 790
                    , 2196, 790, 2196, 790, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+785, netSellCostBuyPrice = netSellCostBuyPrice+790
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+790
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2196
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+790
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2196
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+790
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729de1fe4032 and sellbillId = 143178 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:30:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:00:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:00:57', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:31:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:01:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:01:34', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:31:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:01:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:01:43', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'نفحة', '', '5', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '1300',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1305.00','5', '1', '1', 'إضافة مصروف', '24269', '1300', '2024-11-05 11:01:43', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'نفحة', expensesdetails = '', expensesValue = '5.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24269';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:31:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:01:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:01:43', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:31:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:01:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:01:45', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:32:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:02:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 11:02:08', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:32:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:02:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:02:52', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:33:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:03:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:03:19', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كهربا تقفيل', '', '300', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '1000',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1300.00','300', '1', '1', 'إضافة مصروف', '24270', '1000', '2024-11-05 11:03:19', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كهربا تقفيل', expensesdetails = '', expensesValue = '300.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24270';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:33:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:03:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:03:19', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:33:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:03:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:03:21', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:33:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:03:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 11:03:44', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:44:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:14:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:14:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:45:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:15:01", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 11:15:01', '77', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:45:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:15:17", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 11:15:17', '77', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE productunit SET proUnitSellAllPrice  = 900 * productnumber  ,proUnitSellHalfPrice = 900 * productnumber,proUnitSellUnitPrice = 900 * productnumber WHERE productid = 15796;
UPDATE product SET productName = 'H1416', productDescription = '', productCatId = '14', productBuyPrice = '670.00', productSellAllPrice = '900', productSellUnitPrice = '900', productSellHalfPrice = '900', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1416',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '670.00',lastbuyprice_withDiscount = '670',meanbuyprice = '670.00',meanbuyprice_withDiscount = '670' , productbuypricereal = '670.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='670',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='670',meanbuyprice_withTax='670',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='670'  WHERE productId = '15796';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15796, 1,'2024-11-05 11:21:36',77)
                ON DUPLICATE KEY UPDATE productid = 15796, edited = 1, sysdate = '2024-11-05 11:21:36', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:52:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:22:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:22:22', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e1dca7bba
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:14:04', '06729e1dca7bba', '1', '0.00', '0', '0', '1', '1470.00', '1470', '1470', '0', '1', '2024-11-05 11:22:22', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1470','0','','0','0','1470','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143179', '0', '2024-11-05 11:22:22', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1470', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:14:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34783;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1416', '143179', '14', '15796', '1', '900', '900', '0', '', '1', '2024-11-05 11:22:22', '15796', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34783-1,','1','1','0','0','900','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 523356;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15796, '2024-11-05', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 11:22:22' WHERE storedetailid = '15795';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15796', '1', '1', '1', '143179', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 11:22:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34664;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1409', '143179', '14', '15689', '1', '570', '570', '0', '', '1', '2024-11-05 11:22:23', '15689', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34664-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 523357;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15689, '2024-11-05', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-05 11:22:23' WHERE storedetailid = '15688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15689', '1', '1', '1', '143179', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '9', '2024-11-05 11:22:23','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2470',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1000','1470', '0', '1', 'اضافة فاتورة مبيعات', '143179', '2470', '2024-11-05 11:22:23', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1470, 1160, 1160
                    , 1160, 1160, 1160, 1160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1160, 1160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1470, 1160, 1160
                    , 1160, 1160, 1160, 1160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1160, 1160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1470, 1160, 1160
                    , 1160, 1160, 1160, 1160, 1160, 1160)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1470, netSellCostBuyPrice = netSellCostBuyPrice+1160
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1160
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1160
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1160
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1160
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1160
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1160
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1160;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e1dca7bba and sellbillId = 143179 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:52:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:22:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:22:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:57:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:27:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:27:58', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e3cfb792b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:22:23', '06729e3cfb792b', '1', '0.00', '0', '0', '1', '295.00', '295', '295', '0', '1', '2024-11-05 11:27:58', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','295','0','','0','0','295','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143180', '0', '2024-11-05 11:27:58', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '295', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:22:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28901;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R2629', '143180', '1', '12864', '1', '165', '165', '0', '', '1', '2024-11-05 11:27:58', '12864', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28901-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 297.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 297.00
        
                where sellbilldetailid = 523358;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12864, '2024-11-05', 165, 260, 260
                    , 297, 260, 297, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+297
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+297
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 260, 260
                    , 297, 260, 297, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+297
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+297
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-05 11:27:58' WHERE storedetailid = '12863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12864', '1', '1', '1', '143180', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-05 11:27:58','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29588;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','R2697', '143180', '1', '13236', '1', '130', '130', '0', '', '1', '2024-11-05 11:27:58', '13236', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29588-1,','1','1','0','0','130','130','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        
                where sellbilldetailid = 523359;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13236, '2024-11-05', 130, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+130, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 130, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+130, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 11:27:58' WHERE storedetailid = '13235';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13236', '1', '1', '1', '143180', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 11:27:58','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2765',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('2470','295', '0', '1', 'اضافة فاتورة مبيعات', '143180', '2765', '2024-11-05 11:27:58', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 295, 460, 460
                    , 497, 460, 497, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+497
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+497
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 295, 460, 460
                    , 497, 460, 497, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+497
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+497
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 295, 460, 460
                    , 497, 460, 497, 460, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+295, netSellCostBuyPrice = netSellCostBuyPrice+460
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+460
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+497
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+460
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+497
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+460
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e3cfb792b and sellbillId = 143180 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 07:57:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:27:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:27:59', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:02:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:32:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:32:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:04:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:34:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:34:07', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e51f56ca5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:27:59', '06729e51f56ca5', '1', '0.00', '0', '0', '1', '490.00', '490', '490', '0', '1', '2024-11-05 11:34:07', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','490','0','','0','0','490','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143181', '0', '2024-11-05 11:34:07', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '490', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:27:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34637;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','H1424', '143181', '14', '15711', '1', '490', '490', '0', '', '1', '2024-11-05 11:34:07', '15711', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34637-1,','1','1','0','0','490','490','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523360;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15711, '2024-11-05', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 11:34:07' WHERE storedetailid = '15710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15711', '1', '1', '1', '143181', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-05 11:34:07','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '3255',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('2765','490', '0', '1', 'اضافة فاتورة مبيعات', '143181', '3255', '2024-11-05 11:34:07', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 490, 360, 360
                    , 360, 360, 360, 360, 360, 360)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+490, netSellCostBuyPrice = netSellCostBuyPrice+360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+360
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+360
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+360
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+360;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e51f56ca5 and sellbillId = 143181 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:04:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:34:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:34:07', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:04:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:34:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:34:20', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e63be1a90
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:32:43', '06729e63be1a90', '1', '0.00', '0', '0', '1', '1360.00', '1360', '1360', '0', '1', '2024-11-05 11:34:20', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1360','0','','0','0','1360','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143182', '0', '2024-11-05 11:34:20', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1360', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:32:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34453;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('620','H1389', '143182', '14', '15593', '1', '740', '740', '0', '', '1', '2024-11-05 11:34:20', '15593', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34453-1,','1','1','0','0','740','740','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 620.00 , meanbuyprice = 620.00, lastbuyprice_withDiscount = 620.00, meanbuyprice_withDiscount = 620.00
        , lastbuyprice_withTax = 620, meanbuyprice_withTax = 620, lastbuyprice_withDiscountAndTax = 620
                where sellbilldetailid = 523361;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15593, '2024-11-05', 740, 620, 620
                    , 620, 620, 620, 620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 620, 620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 740, 620, 620
                    , 620, 620, 620, 620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 620, 620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 11:34:20' WHERE storedetailid = '15592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15593', '1', '1', '1', '143182', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 11:34:20','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34749;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1438', '143182', '14', '15774', '1', '620', '620', '0', '', '1', '2024-11-05 11:34:21', '15774', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34749-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523362;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15774, '2024-11-05', 620, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 11:34:21' WHERE storedetailid = '15773';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15774', '1', '1', '1', '143182', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 11:34:21','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '4615',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('3255','1360', '0', '1', 'اضافة فاتورة مبيعات', '143182', '4615', '2024-11-05 11:34:21', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1360, 1120, 1120
                    , 1120, 1120, 1120, 1120
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1120, 1120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1360, sellCostBuyPrice =sellCostBuyPrice+1120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1360, 1120, 1120
                    , 1120, 1120, 1120, 1120
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1120, 1120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1360, sellCostBuyPrice =sellCostBuyPrice+1120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1360, 1120, 1120
                    , 1120, 1120, 1120, 1120, 1120, 1120)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1360, netSellCostBuyPrice = netSellCostBuyPrice+1120
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1120
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1120
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1120
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1120
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1120
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1120
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1120;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e63be1a90 and sellbillId = 143182 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:04:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:34:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:34:21', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:06:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:36:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:36:11', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e69dd3f3b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:34:21', '06729e69dd3f3b', '1', '0.00', '0', '0', '1', '990.00', '990', '990', '0', '1', '2024-11-05 11:36:11', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','990','0','','0','0','990','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143183', '0', '2024-11-05 11:36:11', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '990', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:34:21','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34423;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('485','R3225', '143183', '1', '15517', '1', '570', '570', '0', '', '1', '2024-11-05 11:36:11', '15517', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34423-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        
                where sellbilldetailid = 523363;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15517, '2024-11-05', 570, 485, 485
                    , 485, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 485, 485
                    , 485, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 11:36:11' WHERE storedetailid = '15516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15517', '1', '1', '1', '143183', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 11:36:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34820;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','R3275', '143183', '1', '15818', '1', '420', '420', '0', '', '1', '2024-11-05 11:36:11', '15818', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34820-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523364;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15818, '2024-11-05', 420, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-05 11:36:11' WHERE storedetailid = '15817';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15818', '1', '1', '1', '143183', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-05 11:36:11','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '5605',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('4615','990', '0', '1', 'اضافة فاتورة مبيعات', '143183', '5605', '2024-11-05 11:36:11', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 990, 845, 845
                    , 845, 845, 845, 845
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+845
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+845, sellCostMeanBuyPrice = sellCostMeanBuyPrice+845
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+845, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+845
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+845
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 990, 845, 845
                    , 845, 845, 845, 845
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+845
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+845, sellCostMeanBuyPrice = sellCostMeanBuyPrice+845
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+845, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+845
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+845
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 990, 845, 845
                    , 845, 845, 845, 845, 360, 360)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+990, netSellCostBuyPrice = netSellCostBuyPrice+845
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+845
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+845
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+845
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+845
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+845
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+360;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e69dd3f3b and sellbillId = 143183 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:06:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:36:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:36:12', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:07:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:37:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:37:48', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e70cb47aa
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:36:12', '06729e70cb47aa', '1', '0.00', '0', '0', '1', '1245.00', '1245', '1245', '0', '1', '2024-11-05 11:37:48', '', '9', '0', 'نقدي', '1', '0', '3', '92', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1245','0','','0','0','1245','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143184', '0', '2024-11-05 11:37:48', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1245', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:36:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34467;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06836', '143184', '5', '15557', '1', '420', '420', '0', '', '1', '2024-11-05 11:37:48', '15557', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34467-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 194, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 523365;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15557, '2024-11-05', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 11:37:48' WHERE storedetailid = '15556';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15557', '1', '1', '1', '143184', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 11:37:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34458;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','H1393', '143184', '14', '15597', '1', '580', '580', '0', '', '1', '2024-11-05 11:37:48', '15597', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34458-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where sellbilldetailid = 523366;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15597, '2024-11-05', 580, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 11:37:48' WHERE storedetailid = '15596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15597', '1', '1', '1', '143184', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 11:37:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 22469;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','0K479', '143184', '7', '10242', '1', '245', '245', '0', '', '1', '2024-11-05 11:37:48', '10242', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','22469-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523367;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10242, '2024-11-05', 245, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 245, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 11:37:48' WHERE storedetailid = '10241';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10242', '1', '1', '1', '143184', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 11:37:48','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6850',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('5605','1245', '0', '1', 'اضافة فاتورة مبيعات', '143184', '6850', '2024-11-05 11:37:48', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 92 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1245, 1030, 1030
                    , 1030, 1030, 1030, 1030
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,810, 654, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1245, sellCostBuyPrice =sellCostBuyPrice+1030
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1030, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1030
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1030, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1030
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1030
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+654
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1245, 1030, 1030
                    , 1030, 1030, 1030, 1030
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,810, 654, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1245, sellCostBuyPrice =sellCostBuyPrice+1030
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1030, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1030
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1030, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1030
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1030
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+654
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1245, 1030, 1030
                    , 1030, 1030, 1030, 1030, 810, 654)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1245, netSellCostBuyPrice = netSellCostBuyPrice+1030
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1030
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1030
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1030
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1030
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1030
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+810
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+654;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e70cb47aa and sellbillId = 143184 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:07:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:37:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:37:49', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:11:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:41:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:41:43', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e76d72322
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:37:49', '06729e76d72322', '1', '0.00', '0', '0', '1', '2720.00', '2720', '2720', '0', '1', '2024-11-05 11:41:43', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','2720','0','','0','0','2720','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143185', '0', '2024-11-05 11:41:43', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2720', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:37:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34708;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06880', '143185', '5', '15692', '1', '300', '300', '0', '', '1', '2024-11-05 11:41:43', '15692', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34708-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523368;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15692, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-05 11:41:43' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '1', '1', '143185', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-05 11:41:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27839;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','05593', '143185', '5', '12163', '1', '190', '190', '0', '', '1', '2024-11-05 11:41:43', '12163', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27839-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 523369;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12163, '2024-11-05', 190, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 11:41:44' WHERE storedetailid = '12162';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12163', '1', '1', '1', '143185', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-05 11:41:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34712;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('470','06847', '143185', '5', '15578', '2', '520', '1040', '0', '', '1', '2024-11-05 11:41:44', '15578', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34712-2,','1','1','0','0','520','1040','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 469.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 469.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 353, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 523370;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15578, '2024-11-05', 1040, 940, 940
                    , 938, 940, 938, 936.66
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 940, 706, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+938
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+938
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+936.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+706
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1040, 940, 940
                    , 938, 940, 938, 936.66
                    , 0, 0, 0, 0
                    , 0, 0, 0, 940, 706, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+938
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+938
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+936.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+706
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-05 11:41:44' WHERE storedetailid = '15577';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15578', '1', '2', '1', '143185', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '27', '9', '2024-11-05 11:41:44','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','R3245', '143185', '1', '15677', '1', '580', '580', '0', '', '1', '2024-11-05 11:41:44', '15677', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 523371;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15677, '2024-11-05', 580, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-3', userid = '9', storedetaildate = '2024-11-05 11:41:44' WHERE storedetailid = '15676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15677', '1', '1', '1', '143185', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-2', '-3', '9', '2024-11-05 11:41:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 29574;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','S1180', '143185', '3', '12766', '2', '190', '380', '0', '', '1', '2024-11-05 11:41:44', '12766', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29574-2,','1','1','0','0','190','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 268.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 268.00
        
                where sellbilldetailid = 523372;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12766, '2024-11-05', 380, 540, 540
                    , 536, 540, 536, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+536
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 540, 540
                    , 536, 540, 536, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+536
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 11:41:44' WHERE storedetailid = '12765';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12766', '1', '2', '1', '143185', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '4', '9', '2024-11-05 11:41:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34600;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06680', '143185', '5', '15182', '1', '230', '230', '0', '', '1', '2024-11-05 11:41:44', '15182', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34600-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        , lastbuyprice_withTax = 180, meanbuyprice_withTax = 208, lastbuyprice_withDiscountAndTax = 180
                where sellbilldetailid = 523373;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15182, '2024-11-05', 230, 180, 180
                    , 180, 180, 180, 183.12
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 180, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+183.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 230, 180, 180
                    , 180, 180, 180, 183.12
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+183.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 11:41:44' WHERE storedetailid = '15181';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15182', '1', '1', '1', '143185', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 11:41:44','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '9570',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6850','2720', '0', '1', 'اضافة فاتورة مبيعات', '143185', '9570', '2024-11-05 11:41:44', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2720, 2715, 2715
                    , 2709, 2715, 2709, 2704.78
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1855, 1649, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2720, sellCostBuyPrice =sellCostBuyPrice+2715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2715, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2709
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2715, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2709
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2704.78
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1855
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1649
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 2720, 2715, 2715
                    , 2709, 2715, 2709, 2704.78
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1855, 1649, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2720, sellCostBuyPrice =sellCostBuyPrice+2715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2715, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2709
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2715, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2709
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2704.78
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1855
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1649
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2720, 2715, 2715
                    , 2709, 2715, 2709, 2704.78, 1855, 1649)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2720, netSellCostBuyPrice = netSellCostBuyPrice+2715
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2715
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2709
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2715
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2709
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2704.78
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1855
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1649;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e76d72322 and sellbillId = 143185 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:11:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:41:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:41:44', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:13:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:43:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:43:06', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:13:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:43:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:43:22', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'محمد عبدة', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '9470',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('9570.00','100', '1', '1', 'إضافة مصروف', '24271', '9470', '2024-11-05 11:43:22', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'محمد عبدة', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24271';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:13:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:43:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:43:23', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:13:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:43:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 11:43:25', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:13:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:43:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:43:47', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:14:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:44:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:44:59', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e8d4208e1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:43:48', '06729e8d4208e1', '1', '0.00', '0', '0', '1', '570.00', '570', '570', '0', '1', '2024-11-05 11:44:59', '', '9', '0', 'نقدي', '1', '0', '3', '21', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','570','0','','0','0','570','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143186', '0', '2024-11-05 11:44:59', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '570', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:43:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34806;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','06929', '143186', '5', '15805', '1', '270', '270', '0', '', '1', '2024-11-05 11:45:00', '15805', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34806-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 523374;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15805, '2024-11-05', 270, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 11:45:00' WHERE storedetailid = '15804';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15805', '1', '1', '1', '143186', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 11:45:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34774;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R3248', '143186', '1', '15660', '1', '300', '300', '0', '', '1', '2024-11-05 11:45:00', '15660', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34774-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523375;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15660, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 11:45:00' WHERE storedetailid = '15659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15660', '1', '1', '1', '143186', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-05 11:45:00','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '10040',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('9470','570', '0', '1', 'اضافة فاتورة مبيعات', '143186', '10040', '2024-11-05 11:45:00', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 21 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 570, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,440, 440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,440, 440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 570, 440, 440
                    , 440, 440, 440, 440, 440, 440)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+570, netSellCostBuyPrice = netSellCostBuyPrice+440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+440
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+440
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+440
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+440
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+440;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e8d4208e1 and sellbillId = 143186 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:15:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:45:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:45:00', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:15:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:45:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 11:45:31', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:15:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:45:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 11:45:51', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:21:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:51:02", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 11:51:02', '77', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=show');
UPDATE productunit SET proUnitSellAllPrice  = 570 * productnumber  ,proUnitSellHalfPrice = 570 * productnumber,proUnitSellUnitPrice = 570 * productnumber WHERE productid = 15517;
UPDATE product SET productName = 'R3225', productDescription = '', productCatId = '1', productBuyPrice = '485.00', productSellAllPrice = '570', productSellUnitPrice = '570', productSellHalfPrice = '570', productDate = '2024-10-16', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3225',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '485.00',lastbuyprice_withDiscount = '485',meanbuyprice = '485.00',meanbuyprice_withDiscount = '485' , productbuypricereal = '485.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='485',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15517';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15517, 1,'2024-11-05 11:52:20',77)
                ON DUPLICATE KEY UPDATE productid = 15517, edited = 1, sysdate = '2024-11-05 11:52:20', userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:22:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:52:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:52:27', '9', 'showDetail', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143185');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:22:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:52:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:52:42', '9', 'showDetail', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143184');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:23:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 11:53:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:53:36', '9', 'showDetail', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143183');
UPDATE user SET loginip = "" WHERE userid = 77;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:28:45";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 11:58:45", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 11:58:45', '75', '', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:28:46";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:28:53";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 11:58:53", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:58:53', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:28:56";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 11:58:56", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 11:58:56', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('يمني هاني ' , '', '', '01153769505', '0', '', '0', '2024-11-05 12:00:02', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10279', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10279','0','0','0','إضافة عميل جديد','10279', '0', '2024-11-05 12:00:02', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('يمني هاني ', 'يمني هاني ', 'يمني هاني ', 'يمني هاني ', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 12:00:02');
UPDATE client SET clientname = 'يمني هاني ', clientaddress = '', clientphone = '', clientmobile = '01153769505', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11186',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10279';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:31:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:01:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:01:31', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729e69007869
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:34:08', '06729e69007869', '1', '0.00', '0', '0', '1', '620.00', '620', '620', '0', '1', '2024-11-05 12:01:31', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','620','0','','0','0','620','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143187', '0', '2024-11-05 12:01:31', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '620', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 11:34:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34451;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','H1387', '143187', '14', '15591', '1', '620', '620', '0', '', '1', '2024-11-05 12:01:32', '15591', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34451-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 255, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 523376;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15591, '2024-11-05', 620, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 510, 255, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+255
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 510, 255, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+255
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 12:01:32' WHERE storedetailid = '15590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15591', '1', '1', '1', '143187', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 12:01:32','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '10660',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('10040','620', '0', '1', 'اضافة فاتورة مبيعات', '143187', '10660', '2024-11-05 12:01:32', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 620, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,510, 255, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+255
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,510, 255, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+255
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 620, 510, 510
                    , 510, 510, 510, 510, 510, 255)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+620, netSellCostBuyPrice = netSellCostBuyPrice+510
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+510
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+510
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+510
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+510
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+510
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+510
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+255;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729e69007869 and sellbillId = 143187 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:31:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:01:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:01:32', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:33:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:03:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 12:03:19', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:33:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:03:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 12:03:27', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:33:42";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:03:42", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:03:42', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729ec5da3bce
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10279,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:58:53', '06729ec5da3bce', '10279', '0.00', '576', '0', '1', '576.00', '576', '0', '576', '1', '2024-11-05 12:03:43', '', '75', '0', 'يمني هاني ', '2', '1', '3', '83', 'يمني هاني ', '3' ,'0','','','','','-1','0','0','0','0','0','576','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '576', userid = '75' WHERE clientid = '10279';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10279','0.00','576','0','اضافة فاتورة مبيعات','143188', '576', '2024-11-05 12:03:43', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '576', '0', null, '0', null, null,'', '0','1','1','576','1','2024-11-05 11:58:53','0','0');
UPDATE client SET  inUse = 0 where clientid = 10279;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34573;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1373', '143188', '14', '15533', '1', '550', '550', '0', '', '1', '2024-11-05 12:03:43', '15533', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34573-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 407, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523377;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15533, '2024-11-05', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-05 12:03:43' WHERE storedetailid = '15532';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15533', '1', '1', '1', '143188', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-05 12:03:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143188', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 12:03:43', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143188', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-05 12:03:43', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 10279;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 576, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10279, '2024-11-05', 576, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 576, 450, 450
                    , 450, 450, 450, 450, 450, 407)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+576, netSellCostBuyPrice = netSellCostBuyPrice+450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+450
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+450
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+450
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+450
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+407;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729ec5da3bce and sellbillId = 143188 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:33:43";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:03:43", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:03:43', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:34:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:04:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:04:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:35:40";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:05:40", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:05:40', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729ed800fc3e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8667,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:03:44', '06729ed800fc3e', '8667', '0.00', '576', '0', '1', '576.00', '576', '0', '576', '1', '2024-11-05 12:05:40', '', '75', '0', 'عصمت صلاح الدين P466', '2', '1', '3', '82', 'عصمت صلاح الدين P466', '4' ,'0','','','','','-1','0','0','0','0','0','576','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '576', userid = '75' WHERE clientid = '8667';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8667','0.00','576','0','اضافة فاتورة مبيعات','143189', '576', '2024-11-05 12:05:40', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '576', '0', null, '0', null, null,'', '0','1','1','576','1','2024-11-05 12:03:44','0','0');
UPDATE client SET  inUse = 0 where clientid = 8667;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34726;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('215','0K789', '143189', '7', '15760', '1', '275', '275', '0', '', '1', '2024-11-05 12:05:41', '15760', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34726-1,','1','1','0','0','275','275','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 215.00 , meanbuyprice = 215.00, lastbuyprice_withDiscount = 215.00, meanbuyprice_withDiscount = 215.00
        , lastbuyprice_withTax = 215, meanbuyprice_withTax = 215, lastbuyprice_withDiscountAndTax = 215
                where sellbilldetailid = 523380;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15760, '2024-11-05', 275, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 275, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-05 12:05:41' WHERE storedetailid = '15759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15760', '1', '1', '1', '143189', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-05 12:05:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32220;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','R2860', '143189', '1', '14256', '1', '275', '275', '0', '', '1', '2024-11-05 12:05:41', '14256', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32220-1,','1','1','0','0','275','275','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        
                where sellbilldetailid = 523381;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14256, '2024-11-05', 275, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 275, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 12:05:41' WHERE storedetailid = '14255';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14256', '1', '1', '1', '143189', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 12:05:41','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143189', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 12:05:41', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143189', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-05 12:05:41', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 82 where clientid = 8667;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 576, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8667, '2024-11-05', 576, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+576, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 576, 440, 440
                    , 440, 440, 440, 440, 215, 215)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+576, netSellCostBuyPrice = netSellCostBuyPrice+440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+440
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+440
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+440
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+215
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+215;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729ed800fc3e and sellbillId = 143189 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:35:41";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:05:41", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:05:41', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:38:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:08:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:08:25', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729edaa630de
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:04:26', '06729edaa630de', '1', '0.00', '0', '0', '1', '200.00', '200', '200', '0', '1', '2024-11-05 12:08:25', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','200','0','','0','0','200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143190', '0', '2024-11-05 12:08:25', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '200', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 12:04:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34533;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06869', '143190', '5', '15646', '1', '200', '200', '0', '', '1', '2024-11-05 12:08:25', '15646', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34533-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523384;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15646, '2024-11-05', 200, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 12:08:25' WHERE storedetailid = '15645';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15646', '1', '1', '1', '143190', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-05 12:08:25','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '10860',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('10660','200', '0', '1', 'اضافة فاتورة مبيعات', '143190', '10860', '2024-11-05 12:08:25', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 200, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 200, 140, 140
                    , 140, 140, 140, 140, 140, 140)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+200, netSellCostBuyPrice = netSellCostBuyPrice+140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+140
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+140
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+140
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+140;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729edaa630de and sellbillId = 143190 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:38:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:08:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:08:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:39:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:09:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:09:02', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729ecfcb5e69
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:01:32', '06729ecfcb5e69', '1', '0.00', '0', '0', '1', '2030.00', '2030', '2030', '0', '1', '2024-11-05 12:09:03', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','2030','0','','0','0','2030','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143191', '0', '2024-11-05 12:09:03', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2030', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 12:01:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34729;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','R3272', '143191', '1', '15763', '3', '400', '1200', '0', '', '1', '2024-11-05 12:09:03', '15763', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34729-3,','1','1','0','0','400','1200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523385;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15763, '2024-11-05', 1200, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+990
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1200, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+990
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-05 12:09:03' WHERE storedetailid = '15762';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15763', '1', '3', '1', '143191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '9', '9', '2024-11-05 12:09:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34565;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('395','65007', '143191', '1', '15656', '1', '450', '450', '0', '', '1', '2024-11-05 12:09:03', '15656', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34565-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 395.00, meanbuyprice_withDiscount = 395.00
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 395, lastbuyprice_withDiscountAndTax = 395
                where sellbilldetailid = 523386;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15656, '2024-11-05', 450, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 395, 395, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+395
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+395
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 450, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 395, 395, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+395
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+395
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 12:09:03' WHERE storedetailid = '15655';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15656', '1', '1', '1', '143191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-05 12:09:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34704;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','R3250', '143191', '1', '15750', '1', '380', '380', '0', '', '1', '2024-11-05 12:09:03', '15750', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34704-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 523387;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15750, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 12:09:03' WHERE storedetailid = '15749';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15750', '1', '1', '1', '143191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 12:09:03','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '12890',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('10860','2030', '0', '1', 'اضافة فاتورة مبيعات', '143191', '12890', '2024-11-05 12:09:03', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2030, 1705, 1705
                    , 1705, 1705, 1705, 1705
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1705, 1705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2030, sellCostBuyPrice =sellCostBuyPrice+1705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1705
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 2030, 1705, 1705
                    , 1705, 1705, 1705, 1705
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1705, 1705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2030, sellCostBuyPrice =sellCostBuyPrice+1705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1705
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2030, 1705, 1705
                    , 1705, 1705, 1705, 1705, 1705, 1705)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2030, netSellCostBuyPrice = netSellCostBuyPrice+1705
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1705
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1705
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1705
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1705
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1705
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1705
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1705;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729ecfcb5e69 and sellbillId = 143191 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:39:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:09:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:09:03', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:40:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:10:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:10:11', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729eec0143d7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:09:04', '06729eec0143d7', '1', '0.00', '0', '0', '1', '280.00', '280', '280', '0', '1', '2024-11-05 12:10:11', '', '9', '0', 'نقدي', '1', '0', '3', '54', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','280','0','','0','0','280','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143192', '0', '2024-11-05 12:10:11', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '280', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 12:09:04','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','05005', '143192', '5', '10760', '1', '280', '280', '0', '', '1', '2024-11-05 12:10:11', '10760', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        
                where sellbilldetailid = 523388;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10760, '2024-11-05', 280, 580, 580
                    , 580, 580, 580, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 580, 580
                    , 580, 580, 580, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 12:10:11' WHERE storedetailid = '10759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10760', '1', '1', '1', '143192', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 12:10:11','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '13170',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('12890','280', '0', '1', 'اضافة فاتورة مبيعات', '143192', '13170', '2024-11-05 12:10:11', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 54 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 280, 580, 580
                    , 580, 580, 580, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 580, 580
                    , 580, 580, 580, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 280, 580, 580
                    , 580, 580, 580, 0, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+280, netSellCostBuyPrice = netSellCostBuyPrice+580
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+580
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+580
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+580
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+580
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729eec0143d7 and sellbillId = 143192 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:40:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:10:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:10:12', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:57:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:27:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:27:22', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729ef04713c6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:10:12', '06729ef04713c6', '1', '0.00', '0', '0', '1', '1195.00', '1195', '1195', '0', '1', '2024-11-05 12:27:22', '', '9', '0', 'نقدي', '1', '0', '3', '92', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','1195','0','','0','0','1195','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143193', '0', '2024-11-05 12:27:22', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1195', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 12:10:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06160', '143193', '5', '13956', '1', '140', '140', '0', '', '1', '2024-11-05 12:27:22', '13956', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','140','140','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        
                where sellbilldetailid = 523389;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13956, '2024-11-05', 140, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 140, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 12:27:22' WHERE storedetailid = '13955';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13956', '1', '1', '1', '143193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 12:27:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31876;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','R2880', '143193', '1', '14317', '1', '225', '225', '0', '', '1', '2024-11-05 12:27:22', '14317', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31876-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        
                where sellbilldetailid = 523390;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14317, '2024-11-05', 225, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 225, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 12:27:22' WHERE storedetailid = '14316';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14317', '1', '1', '1', '143193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 12:27:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32716;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','R3043', '143193', '1', '14751', '1', '190', '190', '0', '', '1', '2024-11-05 12:27:22', '14751', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32716-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        
                where sellbilldetailid = 523391;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14751, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 12:27:22' WHERE storedetailid = '14750';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14751', '1', '1', '1', '143193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 12:27:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28993;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2557', '143193', '1', '12458', '1', '175', '175', '0', '', '1', '2024-11-05 12:27:22', '12458', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28993-1,','1','1','0','0','175','175','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 278.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 278.00
        
                where sellbilldetailid = 523392;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12458, '2024-11-05', 175, 220, 240
                    , 278, 240, 278, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+175, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+278
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+278
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 175, 220, 240
                    , 278, 240, 278, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+175, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+278
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+278
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 12:27:22' WHERE storedetailid = '12457';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12458', '1', '1', '1', '143193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 12:27:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32151;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','R2895', '143193', '1', '14354', '1', '215', '215', '0', '', '1', '2024-11-05 12:27:22', '14354', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32151-1,','1','1','0','0','215','215','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        
                where sellbilldetailid = 523393;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14354, '2024-11-05', 215, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 215, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-05 12:27:22' WHERE storedetailid = '14353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14354', '1', '1', '1', '143193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-05 12:27:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28581;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','0B989', '143193', '2', '12673', '1', '150', '150', '0', '', '1', '2024-11-05 12:27:22', '12673', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28581-1,','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 271.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 271.00
        
                where sellbilldetailid = 523394;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12673, '2024-11-05', 150, 250, 250
                    , 271, 250, 271, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+271
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+271
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 250, 250
                    , 271, 250, 271, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+271
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+271
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 12:27:22' WHERE storedetailid = '12672';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12673', '1', '1', '1', '143193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 12:27:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29967;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','R2740', '143193', '1', '13430', '1', '100', '100', '0', '', '1', '2024-11-05 12:27:22', '13430', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29967-1,','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        
                where sellbilldetailid = 523395;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13430, '2024-11-05', 100, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 100, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 12:27:22' WHERE storedetailid = '13429';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13430', '1', '1', '1', '143193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 12:27:22','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '14365',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('13170','1195', '0', '1', 'اضافة فاتورة مبيعات', '143193', '14365', '2024-11-05 12:27:22', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 92 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1195, 1275, 1295
                    , 1354, 1295, 1354, 1275
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1195, sellCostBuyPrice =sellCostBuyPrice+1275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1354
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1354
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1195, 1275, 1295
                    , 1354, 1295, 1354, 1275
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1195, sellCostBuyPrice =sellCostBuyPrice+1275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1354
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1354
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1195, 1275, 1295
                    , 1354, 1295, 1354, 1275, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1195, netSellCostBuyPrice = netSellCostBuyPrice+1275
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1295
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1354
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1295
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1354
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1275
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729ef04713c6 and sellbillId = 143193 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 08:57:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:27:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:27:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:01:29";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:31:29", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:31:29', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729edf5e2359
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6554,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:05:41', '06729edf5e2359', '6554', '0.00', '4227', '0', '1', '4227.00', '4227', '0', '4227', '1', '2024-11-05 12:31:29', '', '75', '0', 'انجيل ستور G2', '2', '1', '3', '91', 'انجيل ستور G2', '11' ,'0','','','','','-1','0','0','0','0','0','4227','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '4227', userid = '75' WHERE clientid = '6554';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6554','0.00','4227','0','اضافة فاتورة مبيعات','143194', '4227', '2024-11-05 12:31:29', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4227', '0', null, '0', null, null,'', '0','1','1','4227','1','2024-11-05 12:05:41','0','0');
UPDATE client SET  inUse = 0 where clientid = 6554;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34138;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('390','H1334', '143194', '14', '15412', '1', '490', '490', '0', '', '1', '2024-11-05 12:31:29', '15412', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34138-1,','1','1','0','0','490','490','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        
                where sellbilldetailid = 523396;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15412, '2024-11-05', 490, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 490, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 12:31:29' WHERE storedetailid = '15411';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15412', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 12:31:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34482;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','R3260', '143194', '1', '15617', '1', '385', '385', '0', '', '1', '2024-11-05 12:31:29', '15617', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34482-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 523397;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15617, '2024-11-05', 385, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 310, 310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+310
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 310, 310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+310
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 12:31:29' WHERE storedetailid = '15616';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15617', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 12:31:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34696;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('550','06909', '143194', '5', '15745', '1', '620', '620', '0', '', '1', '2024-11-05 12:31:29', '15745', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34696-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where sellbilldetailid = 523398;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15745, '2024-11-05', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 12:31:29' WHERE storedetailid = '15744';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15745', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 12:31:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143194', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-05 12:31:29', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523399;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '75', storedetaildate = '2024-11-05 12:31:29' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '23', '75', '2024-11-05 12:31:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34206;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','06793', '143194', '5', '15403', '1', '410', '410', '0', '', '1', '2024-11-05 12:31:29', '15403', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34206-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 335.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 335.00
        
                where sellbilldetailid = 523400;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15403, '2024-11-05', 410, 335, 335
                    , 335, 335, 335, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 410, 335, 335
                    , 335, 335, 335, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 12:31:29' WHERE storedetailid = '15402';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15403', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 12:31:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34662;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06809', '143194', '5', '15493', '1', '300', '300', '0', '', '1', '2024-11-05 12:31:29', '15493', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34662-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 244.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 244.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 188, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523401;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15493, '2024-11-05', 300, 245, 245
                    , 244, 245, 244, 242.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+244
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+244
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+242.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 245, 245
                    , 244, 245, 244, 242.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+244
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+244
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+242.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '75', storedetaildate = '2024-11-05 12:31:30' WHERE storedetailid = '15492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15493', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '75', '2024-11-05 12:31:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33652;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('535','06545', '143194', '5', '14961', '1', '600', '600', '0', '', '1', '2024-11-05 12:31:30', '14961', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33652-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 535.00 , meanbuyprice = 525.00, lastbuyprice_withDiscount = 535.00, meanbuyprice_withDiscount = 525.00
        
                where sellbilldetailid = 523402;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14961, '2024-11-05', 600, 535, 535
                    , 525, 535, 525, 523.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+535, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+523.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 600, 535, 535
                    , 525, 535, 525, 523.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+535, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+523.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 12:31:30' WHERE storedetailid = '14960';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14961', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 12:31:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34431;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','R3211', '143194', '1', '15456', '1', '230', '230', '0', '', '1', '2024-11-05 12:31:30', '15456', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34431-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 523403;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15456, '2024-11-05', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 230, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 12:31:30' WHERE storedetailid = '15455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15456', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 12:31:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34377;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1369', '143194', '14', '15545', '1', '650', '650', '0', '', '1', '2024-11-05 12:31:30', '15545', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34377-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        
                where sellbilldetailid = 523404;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15545, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-05 12:31:30' WHERE storedetailid = '15544';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15545', '1', '1', '1', '143194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-05 12:31:30','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143194', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 12:31:30', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143194', '17', '10291', '1', '42', '42', '0', '', '1', '2024-11-05 12:31:30', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','42','42','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 6554;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 4227, 3540, 3540
                    , 3529, 3540, 3529, 3526.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1525, 1468, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4227, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3529
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3529
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3526.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1468
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6554, '2024-11-05', 4227, 3540, 3540
                    , 3529, 3540, 3529, 3526.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1525, 1468, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4227, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3529
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3529
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3526.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1468
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4227, 3540, 3540
                    , 3529, 3540, 3529, 3526.25, 1525, 1468)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4227, netSellCostBuyPrice = netSellCostBuyPrice+3540
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3540
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3529
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3540
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3529
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3526.25
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1525
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1468;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729edf5e2359 and sellbillId = 143194 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:01:30";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:31:30", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:31:30', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:03:14";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:33:14", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:33:14', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f4032ed16
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(308,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:31:31', '06729f4032ed16', '308', '8.00', '220', '0', '1', '212.00', '212', '0', '212', '1', '2024-11-05 12:33:15', '', '75', '0', 'ايهاب نجيب w51', '2', '1', '3', '83', 'ايهاب نجيب w51', '2' ,'0','','','','','-1','0','0','0','0','0','212','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '220', userid = '75' WHERE clientid = '308';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('308','8.00','212','0','اضافة فاتورة مبيعات','143195', '220', '2024-11-05 12:33:15', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '212', '0', null, '0', null, null,'', '0','1','1','212','1','2024-11-05 12:31:31','0','0');
UPDATE client SET  inUse = 0 where clientid = 308;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34528;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('130','06867', '143195', '5', '15642', '1', '210', '210', '0', '', '1', '2024-11-05 12:33:15', '15642', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34528-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 130.00 , meanbuyprice = 130.00, lastbuyprice_withDiscount = 130.00, meanbuyprice_withDiscount = 130.00
        , lastbuyprice_withTax = 130, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 130
                where sellbilldetailid = 523407;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15642, '2024-11-05', 210, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '75', storedetaildate = '2024-11-05 12:33:15' WHERE storedetailid = '15641';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15642', '1', '1', '1', '143195', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '75', '2024-11-05 12:33:15','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143195', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-05 12:33:15', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 308;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 212, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+212, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (308, '2024-11-05', 212, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+212, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 212, 130, 130
                    , 130, 130, 130, 130, 130, 130)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+212, netSellCostBuyPrice = netSellCostBuyPrice+130
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+130
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+130
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+130
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+130
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+130
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+130
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+130;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f4032ed16 and sellbillId = 143195 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:03:15";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:33:15", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:33:15', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:05:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:35:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:35:36', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:05:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:35:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:35:49', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'زينب', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '14315',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14365.00','50', '1', '1', 'إضافة مصروف', '24272', '14315', '2024-11-05 12:35:49', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'زينب', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24272';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:05:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:35:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:35:49', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:05:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:35:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:35:51', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:05:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:35:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:35:51', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:06:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:36:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:36:01', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ايمان', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '14215',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14315.00','100', '1', '1', 'إضافة مصروف', '24273', '14215', '2024-11-05 12:36:01', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ايمان', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24273';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:06:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:36:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:36:01', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:06:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:36:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:36:03', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:06:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:36:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:36:06', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:06:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:36:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:36:15', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'رضا', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '14165',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14215.00','50', '1', '1', 'إضافة مصروف', '24274', '14165', '2024-11-05 12:36:16', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'رضا', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24274';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:06:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:36:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:36:16', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:06:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:36:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:36:18', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:07:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:37:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:37:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:07:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:37:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:37:12', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f54e21075
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:37:02', '06729f54e21075', '1', '0.00', '0', '0', '1', '290.00', '290', '290', '0', '1', '2024-11-05 12:37:12', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','290','0','','0','0','290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143196', '0', '2024-11-05 12:37:12', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '290', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 12:37:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34433;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143196', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-05 12:37:12', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34433-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 179, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523409;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-05 12:37:12' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-05 12:37:12','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '14455',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14165','290', '0', '1', 'اضافة فاتورة مبيعات', '143196', '14455', '2024-11-05 12:37:12', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 290, 240, 240
                    , 240, 240, 240, 240, 240, 179)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+290, netSellCostBuyPrice = netSellCostBuyPrice+240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+179;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f54e21075 and sellbillId = 143196 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:07:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:37:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:37:13', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:08:44";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:38:44", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:38:44', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f46bf2944
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8305,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:33:16', '06729f46bf2944', '8305', '-490.00', '187', '0', '1', '677.00', '677', '0', '677', '1', '2024-11-05 12:38:44', '', '75', '0', 'مريم ابو شادي X455', '2', '1', '3', '85', 'مريم ابو شادي X455', '4' ,'0','','','','','-1','0','0','0','0','0','677','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '187', userid = '75' WHERE clientid = '8305';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8305','-490.00','677','0','اضافة فاتورة مبيعات','143197', '187', '2024-11-05 12:38:44', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '677', '0', null, '0', null, null,'', '0','1','1','677','1','2024-11-05 12:33:16','0','0');
UPDATE client SET  inUse = 0 where clientid = 8305;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34758;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','H1444', '143197', '14', '15782', '1', '500', '500', '0', '', '1', '2024-11-05 12:38:44', '15782', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34758-1,','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 523410;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15782, '2024-11-05', 500, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '75', storedetaildate = '2024-11-05 12:38:44' WHERE storedetailid = '15781';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15782', '1', '1', '1', '143197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '75', '2024-11-05 12:38:44','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','عرض 150', '143197', '18', '10355', '1', '150', '150', '0', '', '1', '2024-11-05 12:38:44', '10355', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523411;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10355, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-49', userid = '75', storedetaildate = '2024-11-05 12:38:44' WHERE storedetailid = '10354';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10355', '1', '1', '1', '143197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-48', '-49', '75', '2024-11-05 12:38:44','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143197', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 12:38:44', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143197', '17', '10291', '1', '7', '7', '0', '', '1', '2024-11-05 12:38:44', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','7','7','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 8305;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 677, 550, 550
                    , 550, 550, 550, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+677, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8305, '2024-11-05', 677, 550, 550
                    , 550, 550, 550, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+677, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 677, 550, 550
                    , 550, 550, 550, 400, 400, 400)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+677, netSellCostBuyPrice = netSellCostBuyPrice+550
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+550
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+550
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+550
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+550
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+400
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+400;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f46bf2944 and sellbillId = 143197 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:08:45";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:38:45", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:38:45', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:10:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:40:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:40:04', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:10:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:40:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:40:36', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ضحي', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '14355',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14455.00','100', '1', '1', 'إضافة مصروف', '24275', '14355', '2024-11-05 12:40:36', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ضحي', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24275';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:10:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:40:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:40:37', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:10:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:40:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:40:39', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:11:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:41:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:41:41', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729ee9aefc67
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:08:26', '06729ee9aefc67', '1', '0.00', '0', '0', '1', '905.00', '905', '905', '0', '1', '2024-11-05 12:41:41', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','905','0','','0','0','905','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143198', '0', '2024-11-05 12:41:41', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '905', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 12:08:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34717;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1434', '143198', '14', '15756', '1', '600', '600', '0', '', '1', '2024-11-05 12:41:41', '15756', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34717-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523414;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15756, '2024-11-05', 600, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 600, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-05 12:41:41' WHERE storedetailid = '15755';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15756', '1', '1', '1', '143198', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-05 12:41:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20292;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','0H782', '143198', '14', '8736', '1', '305', '305', '0', '', '1', '2024-11-05 12:41:41', '8736', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20292-1,','1','1','0','0','305','305','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 229.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 229.00
        
                where sellbilldetailid = 523415;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8736, '2024-11-05', 305, 230, 230
                    , 229, 230, 229, 228.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+305, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+229
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+229
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+228.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 305, 230, 230
                    , 229, 230, 229, 228.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+305, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+229
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+229
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+228.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 12:41:41' WHERE storedetailid = '8735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8736', '1', '1', '1', '143198', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 12:41:41','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '15260',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14355','905', '0', '1', 'اضافة فاتورة مبيعات', '143198', '15260', '2024-11-05 12:41:41', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 905, 730, 730
                    , 729, 730, 729, 728.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+905, sellCostBuyPrice =sellCostBuyPrice+730
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+730, sellCostMeanBuyPrice = sellCostMeanBuyPrice+729
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+730, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+729
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+728.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 905, 730, 730
                    , 729, 730, 729, 728.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+905, sellCostBuyPrice =sellCostBuyPrice+730
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+730, sellCostMeanBuyPrice = sellCostMeanBuyPrice+729
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+730, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+729
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+728.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 905, 730, 730
                    , 729, 730, 729, 728.33, 500, 500)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+905, netSellCostBuyPrice = netSellCostBuyPrice+730
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+730
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+729
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+730
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+729
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+728.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+500
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+500;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729ee9aefc67 and sellbillId = 143198 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:11:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:41:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:41:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:15:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:45:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:45:45', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:15:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:45:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:45:54', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'النون', '', '200', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '15060',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('15260.00','200', '1', '1', 'إضافة مصروف', '24276', '15060', '2024-11-05 12:45:54', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'النون', expensesdetails = '', expensesValue = '200.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24276';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:15:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:45:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:45:55', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:15:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:45:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 12:45:56', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:16:03";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:46:03", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:46:03', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f5b5674f6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5812,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:38:45', '06729f5b5674f6', '5812', '758.00', '1187', '0', '1', '429.00', '429', '0', '429', '1', '2024-11-05 12:46:04', '', '75', '0', 'ناريمان مجدي X69', '2', '1', '3', '85', 'ناريمان مجدي X69', '3' ,'0','','','','','-1','0','0','0','0','0','429','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1187', userid = '75' WHERE clientid = '5812';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5812','758.00','429','0','اضافة فاتورة مبيعات','143199', '1187', '2024-11-05 12:46:04', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '429', '0', null, '0', null, null,'', '0','1','1','429','1','2024-11-05 12:38:45','0','0');
UPDATE client SET  inUse = 0 where clientid = 5812;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34808;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06939', '143199', '5', '15807', '1', '210', '210', '0', '', '1', '2024-11-05 12:46:04', '15807', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34808-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 523416;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15807, '2024-11-05', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-05 12:46:04' WHERE storedetailid = '15806';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15807', '1', '1', '1', '143199', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '75', '2024-11-05 12:46:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33007;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06457', '143199', '5', '14734', '1', '215', '215', '0', '', '1', '2024-11-05 12:46:04', '14734', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33007-1,','1','1','0','0','215','215','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 143.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 143.00
        
                where sellbilldetailid = 523417;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14734, '2024-11-05', 215, 150, 150
                    , 143, 150, 143, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+143
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+143
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 215, 150, 150
                    , 143, 150, 143, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+143
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+143
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 12:46:04' WHERE storedetailid = '14733';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14734', '1', '1', '1', '143199', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 12:46:04','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143199', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-05 12:46:04', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 5812;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 429, 310, 310
                    , 303, 310, 303, 302.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+429, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+303
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+303
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+302.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5812, '2024-11-05', 429, 310, 310
                    , 303, 310, 303, 302.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+429, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+303
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+303
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+302.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 429, 310, 310
                    , 303, 310, 303, 302.5, 160, 160)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+429, netSellCostBuyPrice = netSellCostBuyPrice+310
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+310
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+303
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+310
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+303
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+302.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+160
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+160;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f5b5674f6 and sellbillId = 143199 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:16:04";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:46:04", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:46:04', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:19:24";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:49:24", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:49:24', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f76d13c9e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1192,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:46:05', '06729f76d13c9e', '1192', '0.00', '1692', '0', '1', '1692.00', '1692', '0', '1692', '1', '2024-11-05 12:49:24', '', '75', '0', 'شيماء محمد جمال x111', '2', '1', '3', '85', 'شيماء محمد جمال x111', '7' ,'0','','','','','-1','0','0','0','0','0','1692','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1692', userid = '75' WHERE clientid = '1192';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1192','0.00','1692','0','اضافة فاتورة مبيعات','143200', '1692', '2024-11-05 12:49:24', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1692', '0', null, '0', null, null,'', '0','1','1','1692','1','2024-11-05 12:46:05','0','0');
UPDATE client SET  inUse = 0 where clientid = 1192;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34858;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','0K793', '143200', '7', '15834', '1', '280', '280', '0', '', '1', '2024-11-05 12:49:24', '15834', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34858-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523419;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15834, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-05 12:49:24' WHERE storedetailid = '15833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15834', '1', '1', '1', '143200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '75', '2024-11-05 12:49:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34566;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','H1403', '143200', '14', '15657', '1', '300', '300', '0', '', '1', '2024-11-05 12:49:24', '15657', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34566-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523420;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15657, '2024-11-05', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 12:49:24' WHERE storedetailid = '15656';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15657', '1', '1', '1', '143200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-05 12:49:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 21470;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','09537', '143200', '14', '9537', '1', '535', '535', '0', '', '1', '2024-11-05 12:49:24', '9537', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','21470-1,','1','1','0','0','535','535','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        
                where sellbilldetailid = 523421;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9537, '2024-11-05', 535, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+535, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 535, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+535, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 12:49:24' WHERE storedetailid = '9536';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9537', '1', '1', '1', '143200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 12:49:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34027;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06765', '143200', '5', '15347', '1', '300', '300', '0', '', '1', '2024-11-05 12:49:24', '15347', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34027-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 964.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 964.00
        
                where sellbilldetailid = 523422;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15347, '2024-11-05', 300, 250, 250
                    , 964, 250, 964, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+964
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+964
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 250, 250
                    , 964, 250, 964, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+964
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+964
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 12:49:24' WHERE storedetailid = '15346';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15347', '1', '1', '1', '143200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 12:49:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34561;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0K780', '143200', '7', '15672', '1', '240', '240', '0', '', '1', '2024-11-05 12:49:24', '15672', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34561-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        , lastbuyprice_withTax = 195, meanbuyprice_withTax = 197, lastbuyprice_withDiscountAndTax = 195
                where sellbilldetailid = 523423;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15672, '2024-11-05', 240, 195, 195
                    , 195, 195, 195, 196.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 195, 197, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+197
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 195, 195
                    , 195, 195, 195, 196.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 195, 197, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+197
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '32', userid = '75', storedetaildate = '2024-11-05 12:49:24' WHERE storedetailid = '15671';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15672', '1', '1', '1', '143200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '32', '75', '2024-11-05 12:49:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143200', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 12:49:24', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143200', '17', '10291', '1', '17', '17', '0', '', '1', '2024-11-05 12:49:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','17','17','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 1192;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1692, 1255, 1255
                    , 1969, 1255, 1969, 1256.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,645, 647, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1692, sellCostBuyPrice =sellCostBuyPrice+1255
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1255, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1969
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1255, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1969
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1256.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+645
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+647
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1192, '2024-11-05', 1692, 1255, 1255
                    , 1969, 1255, 1969, 1256.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,645, 647, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1692, sellCostBuyPrice =sellCostBuyPrice+1255
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1255, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1969
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1255, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1969
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1256.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+645
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+647
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1692, 1255, 1255
                    , 1969, 1255, 1969, 1256.25, 645, 647)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1692, netSellCostBuyPrice = netSellCostBuyPrice+1255
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1255
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1969
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1255
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1969
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1256.25
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+645
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+647;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f76d13c9e and sellbillId = 143200 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:19:25";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:49:25", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:49:25', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:20:47";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:50:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:50:47', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f835ae456
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10275,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:49:25', '06729f835ae456', '10275', '1520.00', '2298', '0', '1', '778.00', '778', '0', '778', '1', '2024-11-05 12:50:47', '', '75', '0', 'تيا فاشون 52', '2', '1', '3', '98', 'تيا فاشون 52', '5' ,'0','','','','','-1','0','0','0','0','0','778','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2298', userid = '75' WHERE clientid = '10275';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10275','1520.00','778','0','اضافة فاتورة مبيعات','143201', '2298', '2024-11-05 12:50:47', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '778', '0', null, '0', null, null,'', '0','1','1','778','1','2024-11-05 12:49:25','0','0');
UPDATE client SET  inUse = 0 where clientid = 10275;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34914;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','06597', '143201', '5', '15049', '2', '240', '480', '0', '', '1', '2024-11-05 12:50:47', '15049', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34914-2,','1','1','0','0','240','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        , lastbuyprice_withTax = 185, meanbuyprice_withTax = 173, lastbuyprice_withDiscountAndTax = 185
                where sellbilldetailid = 523426;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15049, '2024-11-05', 480, 370, 370
                    , 370, 370, 370, 366.66
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 370, 346, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+366.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+346
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 370, 370
                    , 370, 370, 370, 366.66
                    , 0, 0, 0, 0
                    , 0, 0, 0, 370, 346, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+366.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+346
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 12:50:47' WHERE storedetailid = '15048';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15049', '1', '2', '1', '143201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '14', '75', '2024-11-05 12:50:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143201', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-05 12:50:47', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523427;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '45', userid = '75', storedetaildate = '2024-11-05 12:50:47' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '46', '45', '75', '2024-11-05 12:50:47','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143201', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 12:50:48', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143201', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-05 12:50:48', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 10275;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 778, 590, 590
                    , 590, 590, 590, 586.66
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,590, 566, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+778, sellCostBuyPrice =sellCostBuyPrice+590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+590, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+590
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+586.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+566
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10275, '2024-11-05', 778, 590, 590
                    , 590, 590, 590, 586.66
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,590, 566, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+778, sellCostBuyPrice =sellCostBuyPrice+590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+590, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+590
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+586.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+566
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 778, 590, 590
                    , 590, 590, 590, 586.66, 590, 566)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+778, netSellCostBuyPrice = netSellCostBuyPrice+590
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+590
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+590
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+590
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+590
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+586.66
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+590
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+566;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f835ae456 and sellbillId = 143201 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:20:48";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:50:48", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:50:48', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:22:05";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:52:05", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:52:05', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f888cec27
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(539,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:50:48', '06729f888cec27', '539', '0.00', '313', '0', '1', '313.00', '313', '0', '313', '1', '2024-11-05 12:52:05', '', '75', '0', 'عزة محمود T71', '2', '1', '3', '98', 'عزة محمود T71', '3' ,'0','','','','','-1','0','0','0','0','0','313','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '313', userid = '75' WHERE clientid = '539';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('539','0.00','313','0','اضافة فاتورة مبيعات','143202', '313', '2024-11-05 12:52:05', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '313', '0', null, '0', null, null,'', '0','1','1','313','1','2024-11-05 12:50:48','0','0');
UPDATE client SET  inUse = 0 where clientid = 539;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34492;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143202', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-05 12:52:05', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34492-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 179, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523430;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '75', storedetaildate = '2024-11-05 12:52:05' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143202', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '75', '2024-11-05 12:52:05','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143202', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 12:52:05', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143202', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 12:52:05', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 539;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 313, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+313, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (539, '2024-11-05', 313, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+313, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 313, 240, 240
                    , 240, 240, 240, 240, 240, 179)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+313, netSellCostBuyPrice = netSellCostBuyPrice+240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+179;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f888cec27 and sellbillId = 143202 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:22:06";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:52:06", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:52:06', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:25:38";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:55:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:55:38', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f8d68cec0
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(114,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:52:06', '06729f8d68cec0', '114', '17.50', '497.5', '0', '1', '480.00', '480', '0', '480', '1', '2024-11-05 12:55:38', '', '75', '0', 'عواطف نبيل P77', '2', '1', '3', '82', 'عواطف نبيل P77', '4' ,'0','','','','','-1','0','0','0','0','0','480','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '497.5', userid = '75' WHERE clientid = '114';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('114','17.50','480','0','اضافة فاتورة مبيعات','143203', '497.5', '2024-11-05 12:55:38', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '480', '0', null, '0', null, null,'', '0','1','1','480','1','2024-11-05 12:52:06','0','0');
UPDATE client SET  inUse = 0 where clientid = 114;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06361', '143203', '5', '14524', '1', '220', '220', '0', '', '1', '2024-11-05 12:55:38', '14524', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 28, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523433;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14524, '2024-11-05', 220, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 12:55:38' WHERE storedetailid = '14523';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14524', '1', '1', '1', '143203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 12:55:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29058;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2546', '143203', '1', '12384', '1', '235', '235', '0', '', '1', '2024-11-05 12:55:38', '12384', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29058-1,','1','1','0','0','235','235','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 367.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 367.00
        
                where sellbilldetailid = 523434;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12384, '2024-11-05', 235, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 12:55:38' WHERE storedetailid = '12383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12384', '1', '1', '1', '143203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 12:55:38','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143203', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 12:55:38', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143203', '17', '10291', '1', '5', '5', '0', '', '1', '2024-11-05 12:55:38', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','5','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 82 where clientid = 114;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 480, 440, 440
                    , 587, 440, 587, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+587
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+587
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (114, '2024-11-05', 480, 440, 440
                    , 587, 440, 587, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+587
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+587
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 480, 440, 440
                    , 587, 440, 587, 440, 220, 28)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+480, netSellCostBuyPrice = netSellCostBuyPrice+440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+587
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+587
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+440
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+28;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f8d68cec0 and sellbillId = 143203 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:25:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 12:55:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:55:39', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:29:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:59:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:59:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:29:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 12:59:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 12:59:39', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:31:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:01:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 13:01:52', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:32:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:02:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 13:02:05', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'عمر', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '14960',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('15060.00','100', '1', '1', 'إضافة مصروف', '24277', '14960', '2024-11-05 13:02:05', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'عمر', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24277';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:32:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:02:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 13:02:06', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:32:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:02:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 13:02:08', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:32:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:02:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:02:18', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:33:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:03:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:03:05', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729fb3ad786a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:02:18', '06729fb3ad786a', '1', '0.00', '0', '0', '1', '580.00', '580', '580', '0', '1', '2024-11-05 13:03:05', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','580','0','','0','0','580','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143204', '0', '2024-11-05 13:03:05', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '580', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:02:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34458;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','H1393', '143204', '14', '15597', '1', '580', '580', '0', '', '1', '2024-11-05 13:03:05', '15597', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34458-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where sellbilldetailid = 523437;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15597, '2024-11-05', 580, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 13:03:05' WHERE storedetailid = '15596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15597', '1', '1', '1', '143204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 13:03:05','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '15540',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('14960','580', '0', '1', 'اضافة فاتورة مبيعات', '143204', '15540', '2024-11-05 13:03:05', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 580, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 580, 460, 460
                    , 460, 460, 460, 460, 460, 460)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+580, netSellCostBuyPrice = netSellCostBuyPrice+460
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+460
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+460
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+460
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+460
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+460
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+460
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+460;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729fb3ad786a and sellbillId = 143204 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:33:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:03:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:03:05', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:39:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:09:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:09:45', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729fb6a358e3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:03:06', '06729fb6a358e3', '1', '0.00', '0', '10', '1', '520.00', '510', '510', '0', '1', '2024-11-05 13:09:45', '', '9', '0', 'نقدي', '1', '0', '3', '99', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','510','0','','0','0','510','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143205', '0', '2024-11-05 13:09:45', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '510', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:03:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34480;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','H1397', '143205', '14', '15615', '1', '520', '520', '0', '', '1', '2024-11-05 13:09:45', '15615', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34480-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523438;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15615, '2024-11-05', 510, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 510, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-05 13:09:45' WHERE storedetailid = '15614';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15615', '1', '1', '1', '143205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '9', '2024-11-05 13:09:45','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '16050',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('15540','510', '0', '1', 'اضافة فاتورة مبيعات', '143205', '16050', '2024-11-05 13:09:45', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 99 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 510, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 510, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 510, 420, 420
                    , 420, 420, 420, 420, 420, 420)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+510, netSellCostBuyPrice = netSellCostBuyPrice+420
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+420
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+420
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+420
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+420
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+420
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+420
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+420;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729fb6a358e3 and sellbillId = 143205 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:39:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:09:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:09:45', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:41:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:11:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:11:41', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729fcfa2af1a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:09:46', '06729fcfa2af1a', '1', '0.00', '0', '0', '1', '730.00', '730', '730', '0', '1', '2024-11-05 13:11:41', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','730','0','','0','0','730','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143206', '0', '2024-11-05 13:11:41', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '730', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:09:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34773;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06926', '143206', '5', '15787', '1', '240', '240', '0', '', '1', '2024-11-05 13:11:41', '15787', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34773-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        , lastbuyprice_withTax = 180, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 180
                where sellbilldetailid = 523439;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15787, '2024-11-05', 240, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 13:11:41' WHERE storedetailid = '15786';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15787', '1', '1', '1', '143206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 13:11:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34822;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06934', '143206', '5', '15820', '1', '200', '200', '0', '', '1', '2024-11-05 13:11:41', '15820', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34822-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        , lastbuyprice_withTax = 145, meanbuyprice_withTax = 145, lastbuyprice_withDiscountAndTax = 145
                where sellbilldetailid = 523440;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15820, '2024-11-05', 200, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 145, 145, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+145
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 145, 145, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+145
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-05 13:11:41' WHERE storedetailid = '15819';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15820', '1', '1', '1', '143206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-05 13:11:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34833;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','06859', '143206', '5', '15612', '1', '290', '290', '0', '', '1', '2024-11-05 13:11:41', '15612', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34833-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523441;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15612, '2024-11-05', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 13:11:41' WHERE storedetailid = '15611';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15612', '1', '1', '1', '143206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 13:11:41','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '16780',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16050','730', '0', '1', 'اضافة فاتورة مبيعات', '143206', '16780', '2024-11-05 13:11:41', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 730, 555, 555
                    , 555, 555, 555, 557.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,555, 555, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+730, sellCostBuyPrice =sellCostBuyPrice+555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+555
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+555
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+557.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+555
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+555
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 730, 555, 555
                    , 555, 555, 555, 557.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,555, 555, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+730, sellCostBuyPrice =sellCostBuyPrice+555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+555
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+555
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+557.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+555
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+555
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 730, 555, 555
                    , 555, 555, 555, 557.5, 555, 555)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+730, netSellCostBuyPrice = netSellCostBuyPrice+555
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+555
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+555
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+555
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+555
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+557.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+555
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+555;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729fcfa2af1a and sellbillId = 143206 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:41:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:11:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:11:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:46:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:16:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 13:16:28', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:47:00";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:47:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:17:09", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 13:17:09', '77', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:47:10";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:47:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:17:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:17:18', '77', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:47:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:17:24", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:17:24', '77', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:47:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:17:42", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:17:42', '77', 'showDetail', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142202');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:47:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:17:43", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:17:43', '77', 'showDetail', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142202');
UPDATE user SET loginip = "" WHERE userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:48:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:18:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:18:10', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:48:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:18:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:18:31', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:48:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:18:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:18:32', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:48:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:18:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:18:57', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729fa9b692d5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 12:59:39', '06729fa9b692d5', '1', '0.00', '0', '0', '1', '380', '380', '-380', '0', '1', '2024-11-05 13:18:57', '', '9', '0', 'نقدي','1', '0', '5', '97', 'نقدي', '2', '0', '', '','','','-1','0','0','0','','0','-380','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16227', '0', '2024-11-05 13:18:57', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '380', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 12:59:39','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('140.00', '06656', '16227', '5', '15118', '1', '190', '190', '0', '', '1', '0', '15118', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','190','190','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        
                where returnsellbilldetailid = 21265;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15118, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 140
                    , 140, 140, 140, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+140, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+140
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+140
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 140
                    , 140, 140, 140, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+140, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+140
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+140
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 13:18:57' WHERE storedetailid = '15117';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15118', '1', '1', '0', '16227', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '3', '4', '9', '2024-11-05 13:18:57','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('140.00', '06419', '16227', '5', '14600', '1', '190', '190', '0', '', '1', '0', '14600', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','190','190','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 136.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 136.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 102, lastbuyprice_withDiscountAndTax = 140
                where returnsellbilldetailid = 21266;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14600, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 136
                    , 140, 136, 140.91, 0, 1, 0, 0, 140, 102)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+136, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+136
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+140.91
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+140
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+102
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 136
                    , 140, 136, 140.91, 0, 0, 140, 102)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+136, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+136
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+140.91
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+140
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+102;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 13:18:57' WHERE storedetailid = '14599';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14600', '1', '1', '0', '16227', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '-1', '0', '9', '2024-11-05 13:18:57','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '16400',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16780','-380', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16227', '16400', '2024-11-05 13:18:57', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 380, 280, 280, 276
                    , 280, 276, 280.91 ,0, 0, 140, 102)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+380, returnSellCostBuyPrice = returnSellCostBuyPrice+280, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+280
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+276, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+280
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+276
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+280.91
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+140
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+102;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 380, 280, 280, 276
                    , 280, 276, 280.91 ,0, 0, 140, 102)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+380, returnSellCostBuyPrice = returnSellCostBuyPrice+280, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+280
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+276, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+280
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+276
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+280.91
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+140
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+102;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -380, -280, -280
                    , -276, -280, -276, -280.91, -140, -102)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-380, netSellCostBuyPrice = netSellCostBuyPrice+-280
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-280
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-276
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-280
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-276
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-280.91
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-102;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729fa9b692d5 and sellbillId = 16227 and returnsellbillId = 16227
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:48:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:18:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:18:58', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:49:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:19:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:19:09', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729ff08724bb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:18:32', '06729ff08724bb', '1', '0.00', '0', '0', '1', '1160.00', '1160', '1160', '0', '1', '2024-11-05 13:19:09', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1160','0','','0','0','1160','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143207', '0', '2024-11-05 13:19:09', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1160', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:18:32','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('595','H1400', '143207', '14', '15652', '1', '650', '650', '0', '', '1', '2024-11-05 13:19:09', '15652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 595.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 595.00
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where sellbilldetailid = 523442;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15652, '2024-11-05', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '9', storedetaildate = '2024-11-05 13:19:09' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '1', '1', '143207', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '9', '2024-11-05 13:19:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34385;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('455','R3205', '143207', '1', '15411', '1', '510', '510', '0', '', '1', '2024-11-05 13:19:09', '15411', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34385-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 455.00 , meanbuyprice = 517.00, lastbuyprice_withDiscount = 455.00, meanbuyprice_withDiscount = 517.00
        
                where sellbilldetailid = 523443;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15411, '2024-11-05', 510, 455, 455
                    , 517, 455, 517, 448.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+455
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+517
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+517
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+448.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 510, 455, 455
                    , 517, 455, 517, 448.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+455
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+517
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+517
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+448.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-05 13:19:09' WHERE storedetailid = '15410';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15411', '1', '1', '1', '143207', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-05 13:19:09','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '17560',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('16400','1160', '0', '1', 'اضافة فاتورة مبيعات', '143207', '17560', '2024-11-05 13:19:09', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1160, 1050, 1050
                    , 1112, 1050, 1112, 1043.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1160, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1112
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1112
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1043.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1160, 1050, 1050
                    , 1112, 1050, 1112, 1043.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1160, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1112
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1112
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1043.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1160, 1050, 1050
                    , 1112, 1050, 1112, 1043.75, 595, 595)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1160, netSellCostBuyPrice = netSellCostBuyPrice+1050
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1050
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1112
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1050
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1112
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1043.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+595
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+595;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729ff08724bb and sellbillId = 143207 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:49:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:19:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:19:09', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:49:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:19:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:19:55', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729ff2e2fa55
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:19:10', '06729ff2e2fa55', '1', '0.00', '0', '0', '1', '310.00', '310', '310', '0', '1', '2024-11-05 13:19:55', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','310','0','','0','0','310','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143208', '0', '2024-11-05 13:19:55', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '310', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:19:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34828;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06943', '143208', '5', '15825', '1', '310', '310', '0', '', '1', '2024-11-05 13:19:56', '15825', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34828-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523444;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15825, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 13:19:56' WHERE storedetailid = '15824';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15825', '1', '1', '1', '143208', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 13:19:56','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '17870',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17560','310', '0', '1', 'اضافة فاتورة مبيعات', '143208', '17870', '2024-11-05 13:19:56', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 310, 250, 250
                    , 250, 250, 250, 250, 250, 250)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+310, netSellCostBuyPrice = netSellCostBuyPrice+250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+250
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+250
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+250
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+250
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+250;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729ff2e2fa55 and sellbillId = 143208 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:49:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:19:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:19:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:50:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:20:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 13:20:24', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:51:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:21:21", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('suppliersAndProductsReportController.php', '2024-11-05 13:21:21', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/suppliersAndProductsReportController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:51:24";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:21:24", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 13:21:24', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:51:47";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:21:47", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 13:21:47', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:54:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:24:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 13:24:01', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:54:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:24:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 13:24:36', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:54:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:24:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 13:24:44', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'زباله', '', '5', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '17865',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17870.00','5', '1', '1', 'إضافة مصروف', '24278', '17865', '2024-11-05 13:24:44', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'زباله', expensesdetails = '', expensesValue = '5.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24278';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:54:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:24:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 13:24:44', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:54:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:24:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 13:24:46', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:55:00";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:55:10";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 13:25:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 13:25:10', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:55:11";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:55:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:25:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:25:58', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:58:30";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:28:30", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:28:30', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:58:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 13:28:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 13:28:46', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:59:25";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:29:25", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:29:25', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729f9aba066c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1486,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:55:39', '06729f9aba066c', '1486', '2.00', '1416', '0', '1', '1414.00', '1414', '0', '1414', '1', '2024-11-05 13:29:25', '', '75', '0', 'كرستينا كرم Y67', '2', '1', '3', '98', 'كرستينا كرم Y67', '6' ,'0','','','','','-1','0','0','0','0','0','1414','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1416', userid = '75' WHERE clientid = '1486';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1486','2.00','1414','0','اضافة فاتورة مبيعات','143209', '1416', '2024-11-05 13:29:25', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1414', '0', null, '0', null, null,'', '0','1','1','1414','1','2024-11-05 12:55:39','0','0');
UPDATE client SET  inUse = 0 where clientid = 1486;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','عرض 150', '143209', '18', '10355', '1', '150', '150', '0', '', '1', '2024-11-05 13:29:25', '10355', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523445;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10355, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-50', userid = '75', storedetaildate = '2024-11-05 13:29:25' WHERE storedetailid = '10354';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10355', '1', '1', '1', '143209', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-49', '-50', '75', '2024-11-05 13:29:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06861', '143209', '5', '15635', '1', '300', '300', '0', '', '1', '2024-11-05 13:29:25', '15635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34892-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523446;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15635, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-9', userid = '75', storedetaildate = '2024-11-05 13:29:25' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '1', '1', '143209', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-8', '-9', '75', '2024-11-05 13:29:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34291;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','H1341', '143209', '14', '15439', '1', '580', '580', '0', '', '1', '2024-11-05 13:29:25', '15439', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34291-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        
                where sellbilldetailid = 523447;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15439, '2024-11-05', 580, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 13:29:25' WHERE storedetailid = '15438';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15439', '1', '1', '1', '143209', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 13:29:25','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0H805', '143209', '14', '8797', '1', '350', '350', '0', '', '1', '2024-11-05 13:29:25', '8797', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523448;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8797, '2024-11-05', 350, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-3', userid = '75', storedetaildate = '2024-11-05 13:29:25' WHERE storedetailid = '8796';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8797', '1', '1', '1', '143209', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-2', '-3', '75', '2024-11-05 13:29:25','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143209', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:29:25', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143209', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-05 13:29:25', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 1486;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1414, 1170, 1170
                    , 1170, 1170, 1170, 1020
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1414, sellCostBuyPrice =sellCostBuyPrice+1170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1020
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1486, '2024-11-05', 1414, 1170, 1170
                    , 1170, 1170, 1170, 1020
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1414, sellCostBuyPrice =sellCostBuyPrice+1170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1020
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1414, 1170, 1170
                    , 1170, 1170, 1170, 1020, 240, 240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1414, netSellCostBuyPrice = netSellCostBuyPrice+1170
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1170
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1170
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1170
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1170
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1020
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729f9aba066c and sellbillId = 143209 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 09:59:26";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:29:26", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:29:26', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:02:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:32:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:32:31', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a00c7124ac
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:25:59', '0672a00c7124ac', '1', '0.00', '0', '0', '1', '290.00', '290', '290', '0', '1', '2024-11-05 13:32:31', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','290','0','','0','0','290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143210', '0', '2024-11-05 13:32:31', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '290', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:25:59','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34491;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06508', '143210', '5', '14857', '1', '290', '290', '0', '', '1', '2024-11-05 13:32:31', '14857', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34491-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 243.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 243.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523451;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14857, '2024-11-05', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-05 13:32:31' WHERE storedetailid = '14856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14857', '1', '1', '1', '143210', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '9', '2024-11-05 13:32:31','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '18155',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('17865','290', '0', '1', 'اضافة فاتورة مبيعات', '143210', '18155', '2024-11-05 13:32:31', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 290, 240, 240
                    , 243, 240, 243, 240, 240, 185)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+290, netSellCostBuyPrice = netSellCostBuyPrice+240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+243
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+243
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+185;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a00c7124ac and sellbillId = 143210 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:02:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:32:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:32:32', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:03:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:33:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:33:52', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729fd6e75857
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:11:42', '06729fd6e75857', '1', '0.00', '0', '0', '1', '220.00', '220', '220', '0', '1', '2024-11-05 13:33:52', '', '9', '0', 'نقدي', '1', '0', '3', '73', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','220','0','','0','0','220','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143211', '0', '2024-11-05 13:33:52', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '220', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:11:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34517;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3262', '143211', '1', '15636', '1', '220', '220', '0', '', '1', '2024-11-05 13:33:52', '15636', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34517-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523452;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15636, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-05 13:33:52' WHERE storedetailid = '15635';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15636', '1', '1', '1', '143211', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-05 13:33:52','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '18375',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('18155','220', '0', '1', 'اضافة فاتورة مبيعات', '143211', '18375', '2024-11-05 13:33:52', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 73 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 220, 165, 165
                    , 165, 165, 165, 165, 165, 165)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+220, netSellCostBuyPrice = netSellCostBuyPrice+165
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+165
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+165
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+165
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+165
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+165
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+165
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+165;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729fd6e75857 and sellbillId = 143211 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:03:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:33:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:33:53', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:04:54";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:34:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:34:54', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a019636843
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4825,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:29:26', '0672a019636843', '4825', '4.00', '2226', '0', '1', '2222.00', '2222', '0', '2222', '1', '2024-11-05 13:34:54', '', '75', '0', 'رشا عادل U41', '2', '1', '3', '91', 'رشا عادل U41', '12' ,'0','','','','','-1','0','0','0','0','0','2222','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2226', userid = '75' WHERE clientid = '4825';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4825','4.00','2222','0','اضافة فاتورة مبيعات','143212', '2226', '2024-11-05 13:34:54', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2222', '0', null, '0', null, null,'', '0','1','1','2222','1','2024-11-05 13:29:26','0','0');
UPDATE client SET  inUse = 0 where clientid = 4825;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R2624', '143212', '1', '12859', '1', '165', '165', '0', '', '1', '2024-11-05 13:34:54', '12859', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28892-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523453;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12859, '2024-11-05', 165, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '12858';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12859', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 13:34:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31774;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('325','06245', '143212', '5', '14200', '1', '305', '305', '0', '', '1', '2024-11-05 13:34:54', '14200', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31774-1,','1','1','0','0','305','305','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 325.00 , meanbuyprice = 325.00, lastbuyprice_withDiscount = 325.00, meanbuyprice_withDiscount = 325.00
        
                where sellbilldetailid = 523454;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14200, '2024-11-05', 305, 325, 325
                    , 325, 325, 325, 325
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+305, sellCostBuyPrice =sellCostBuyPrice+325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+325
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+325
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+325
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 305, 325, 325
                    , 325, 325, 325, 325
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+305, sellCostBuyPrice =sellCostBuyPrice+325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+325
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+325
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+325
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '14199';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14200', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 13:34:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27603;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','R2526', '143212', '1', '12291', '1', '155', '155', '0', '', '1', '2024-11-05 13:34:54', '12291', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27603-1,','1','1','0','0','155','155','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        
                where sellbilldetailid = 523455;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12291, '2024-11-05', 155, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+155, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 155, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+155, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '12290';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12291', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 13:34:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34491;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06508', '143212', '5', '14857', '1', '290', '290', '0', '', '1', '2024-11-05 13:34:54', '14857', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34491-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 243.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 243.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523456;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14857, '2024-11-05', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 243, 240, 243, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+243
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+243
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '14856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14857', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '75', '2024-11-05 13:34:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30448;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('115','R2764', '143212', '1', '13671', '1', '95', '95', '0', '', '1', '2024-11-05 13:34:54', '13671', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30448-1,','1','1','0','0','95','95','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 115.00 , meanbuyprice = 115.00, lastbuyprice_withDiscount = 115.00, meanbuyprice_withDiscount = 115.00
        
                where sellbilldetailid = 523457;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13671, '2024-11-05', 95, 115, 115
                    , 115, 115, 115, 115
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 95, 115, 115
                    , 115, 115, 115, 115
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '13670';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13671', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 13:34:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32508;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('280','06226', '143212', '5', '14162', '1', '270', '270', '0', '', '1', '2024-11-05 13:34:54', '14162', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32508-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        
                where sellbilldetailid = 523458;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14162, '2024-11-05', 270, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '14161';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14162', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 13:34:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34714;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06911', '143212', '5', '15755', '1', '240', '240', '0', '', '1', '2024-11-05 13:34:54', '15755', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34714-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 523459;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15755, '2024-11-05', 240, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '15754';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15755', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 13:34:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32356;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06407', '143212', '5', '14572', '1', '225', '225', '0', '', '1', '2024-11-05 13:34:54', '14572', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32356-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        
                where sellbilldetailid = 523460;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14572, '2024-11-05', 225, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 225, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '14571';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14572', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 13:34:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R2647', '143212', '1', '12978', '1', '215', '215', '0', '', '1', '2024-11-05 13:34:54', '12978', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','215','215','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 255.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 255.00
        
                where sellbilldetailid = 523461;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12978, '2024-11-05', 215, 250, 250
                    , 255, 250, 255, 255.71
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+255
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+255
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+255.71
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 215, 250, 250
                    , 255, 250, 255, 255.71
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+255
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+255
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+255.71
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '12977';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12978', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 13:34:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','R2599', '143212', '1', '12676', '1', '220', '220', '0', '', '1', '2024-11-05 13:34:54', '12676', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        
                where sellbilldetailid = 523462;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12676, '2024-11-05', 220, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 13:34:54' WHERE storedetailid = '12675';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12676', '1', '1', '1', '143212', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 13:34:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143212', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:34:55', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143212', '17', '10291', '1', '22', '22', '0', '', '1', '2024-11-05 13:34:55', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','22','22','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 4825;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2222, 2325, 2325
                    , 2333, 2325, 2333, 2330.71
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,415, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2222, sellCostBuyPrice =sellCostBuyPrice+2325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2333
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2333
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2330.71
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+415
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4825, '2024-11-05', 2222, 2325, 2325
                    , 2333, 2325, 2333, 2330.71
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,415, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2222, sellCostBuyPrice =sellCostBuyPrice+2325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2333
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2333
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2330.71
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+415
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2222, 2325, 2325
                    , 2333, 2325, 2333, 2330.71, 415, 360)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2222, netSellCostBuyPrice = netSellCostBuyPrice+2325
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2325
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2333
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2325
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2333
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2330.71
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+415
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+360;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a019636843 and sellbillId = 143212 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:04:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:34:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:34:55', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:05:15";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:35:15", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:35:15', '75', 'showDetail', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143212');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:05:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:35:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:35:39', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:08:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:38:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:38:46', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a02a1d5751
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:33:53', '0672a02a1d5751', '1', '0.00', '0', '0', '1', '500.00', '500', '500', '0', '1', '2024-11-05 13:38:46', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','500','0','','0','0','500','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143213', '0', '2024-11-05 13:38:46', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '500', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:33:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34621;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','R3223', '143213', '1', '15499', '1', '500', '500', '0', '', '1', '2024-11-05 13:38:46', '15499', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34621-1,','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 413, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 523465;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15499, '2024-11-05', 500, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 430, 413, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+413
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 430, 413, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+413
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-05 13:38:46' WHERE storedetailid = '15498';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15499', '1', '1', '1', '143213', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '9', '2024-11-05 13:38:46','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '18875',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('18375','500', '0', '1', 'اضافة فاتورة مبيعات', '143213', '18875', '2024-11-05 13:38:46', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 500, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,430, 413, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+413
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,430, 413, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+413
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 500, 430, 430
                    , 430, 430, 430, 430, 430, 413)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+500, netSellCostBuyPrice = netSellCostBuyPrice+430
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+430
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+430
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+430
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+430
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+430
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+430
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+413;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a02a1d5751 and sellbillId = 143213 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:08:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:38:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:38:46', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:09:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:39:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:39:55', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a030bd3dc5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5202,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:35:39', '0672a030bd3dc5', '5202', '0.00', '3949', '0', '1', '3949.00', '3949', '0', '3949', '1', '2024-11-05 13:39:55', '', '75', '0', 'كرستينا المنصورة U4', '2', '1', '3', '91', 'كرستينا المنصورة U4', '10' ,'0','','','','','-1','0','0','0','0','0','3949','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '3949', userid = '75' WHERE clientid = '5202';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5202','0.00','3949','0','اضافة فاتورة مبيعات','143214', '3949', '2024-11-05 13:39:55', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3949', '0', null, '0', null, null,'', '0','1','1','3949','1','2024-11-05 13:35:39','0','0');
UPDATE client SET  inUse = 0 where clientid = 5202;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34528;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('130','06867', '143214', '5', '15642', '1', '210', '210', '0', '', '1', '2024-11-05 13:39:55', '15642', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34528-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 130.00 , meanbuyprice = 130.00, lastbuyprice_withDiscount = 130.00, meanbuyprice_withDiscount = 130.00
        , lastbuyprice_withTax = 130, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 130
                where sellbilldetailid = 523466;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15642, '2024-11-05', 210, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '75', storedetaildate = '2024-11-05 13:39:55' WHERE storedetailid = '15641';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15642', '1', '1', '1', '143214', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '75', '2024-11-05 13:39:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34696;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('550','06909', '143214', '5', '15745', '1', '620', '620', '0', '', '1', '2024-11-05 13:39:55', '15745', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34696-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where sellbilldetailid = 523467;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15745, '2024-11-05', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 13:39:55' WHERE storedetailid = '15744';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15745', '1', '1', '1', '143214', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 13:39:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34850;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06930', '143214', '5', '15829', '1', '340', '340', '0', '', '1', '2024-11-05 13:39:55', '15829', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34850-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523468;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15829, '2024-11-05', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '75', storedetaildate = '2024-11-05 13:39:55' WHERE storedetailid = '15828';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15829', '1', '1', '1', '143214', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '75', '2024-11-05 13:39:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34875;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1457', '143214', '14', '15841', '1', '520', '520', '0', '', '1', '2024-11-05 13:39:55', '15841', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34875-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523469;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15841, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 13:39:55' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '1', '1', '143214', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 13:39:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34459;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('830','H1391', '143214', '14', '15598', '1', '970', '970', '0', '', '1', '2024-11-05 13:39:55', '15598', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34459-1,','1','1','0','0','970','970','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 830.00 , meanbuyprice = 1092.00, lastbuyprice_withDiscount = 830.00, meanbuyprice_withDiscount = 1092.00
        , lastbuyprice_withTax = 830, meanbuyprice_withTax = 877
                where sellbilldetailid = 523470;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15598, '2024-11-05', 970, 830, 830
                    , 1092, 830, 1092, 615
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 830, 877, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+970, sellCostBuyPrice =sellCostBuyPrice+830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+615
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+877
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 970, 830, 830
                    , 1092, 830, 1092, 615
                    , 0, 0, 0, 0
                    , 0, 0, 0, 830, 877, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+970, sellCostBuyPrice =sellCostBuyPrice+830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+615
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+877
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '75', storedetaildate = '2024-11-05 13:39:55' WHERE storedetailid = '15597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15598', '1', '1', '1', '143214', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '75', '2024-11-05 13:39:55','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('295','06870', '143214', '5', '15653', '1', '360', '360', '0', '', '1', '2024-11-05 13:39:55', '15653', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 147.50, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 147.50
        , lastbuyprice_withTax = 147.5, meanbuyprice_withTax = 147.5
                where sellbilldetailid = 523471;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15653, '2024-11-05', 360, 295, 295
                    , 147.5, 295, 147.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 147.5, 147.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+147.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+147.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+147.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+147.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 360, 295, 295
                    , 147.5, 295, 147.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 147.5, 147.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+147.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+147.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+147.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+147.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-6', userid = '75', storedetaildate = '2024-11-05 13:39:55' WHERE storedetailid = '15652';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15653', '1', '1', '1', '143214', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-5', '-6', '75', '2024-11-05 13:39:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34591;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06874', '143214', '5', '15687', '1', '380', '380', '0', '', '1', '2024-11-05 13:39:55', '15687', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34591-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 523472;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15687, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '75', storedetaildate = '2024-11-05 13:39:55' WHERE storedetailid = '15686';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15687', '1', '1', '1', '143214', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '75', '2024-11-05 13:39:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34637;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','H1424', '143214', '14', '15711', '1', '490', '490', '0', '', '1', '2024-11-05 13:39:55', '15711', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34637-1,','1','1','0','0','490','490','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523473;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15711, '2024-11-05', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 490, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 13:39:55' WHERE storedetailid = '15710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15711', '1', '1', '1', '143214', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 13:39:55','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143214', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:39:55', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143214', '17', '10291', '1', '39', '39', '0', '', '1', '2024-11-05 13:39:56', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','39','39','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 5202;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 3949, 3180, 3180
                    , 3294.5, 3180, 3294.5, 2670
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3032.5, 3079.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3949, sellCostBuyPrice =sellCostBuyPrice+3180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3294.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3294.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3032.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3079.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5202, '2024-11-05', 3949, 3180, 3180
                    , 3294.5, 3180, 3294.5, 2670
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3032.5, 3079.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3949, sellCostBuyPrice =sellCostBuyPrice+3180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3294.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3294.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3032.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3079.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3949, 3180, 3180
                    , 3294.5, 3180, 3294.5, 2670, 3032.5, 3079.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3949, netSellCostBuyPrice = netSellCostBuyPrice+3180
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3180
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3294.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3180
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3294.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2670
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3032.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3079.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a030bd3dc5 and sellbillId = 143214 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:09:56";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:39:56", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:39:56', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:12:38";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:42:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:42:38', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06729ec607d66f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6747,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 11:58:56', '06729ec607d66f', '6747', '-4.00', '814', '0', '1', '818.00', '818', '0', '818', '1', '2024-11-05 13:42:38', '', '75', '0', 'وسام احمد X44', '2', '1', '3', '85', 'وسام احمد X44', '5' ,'0','','','','','-1','0','0','0','0','0','818','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '814', userid = '75' WHERE clientid = '6747';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6747','-4.00','818','0','اضافة فاتورة مبيعات','143215', '814', '2024-11-05 13:42:38', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '818', '0', null, '0', null, null,'', '0','1','1','818','1','2024-11-05 11:58:56','0','0');
UPDATE client SET  inUse = 0 where clientid = 6747;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34070;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','06775', '143215', '5', '15373', '2', '250', '500', '0', '', '1', '2024-11-05 13:42:38', '15373', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34070-2,','1','1','0','0','250','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        
                where sellbilldetailid = 523476;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15373, '2024-11-05', 500, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 13:42:38' WHERE storedetailid = '15372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15373', '1', '2', '1', '143215', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '3', '75', '2024-11-05 13:42:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34833;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','06859', '143215', '5', '15612', '1', '290', '290', '0', '', '1', '2024-11-05 13:42:38', '15612', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34833-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523477;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15612, '2024-11-05', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 230, 230
                    , 230, 230, 230, 232.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+232.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 13:42:38' WHERE storedetailid = '15611';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15612', '1', '1', '1', '143215', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 13:42:38','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143215', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:42:38', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143215', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-05 13:42:38', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 6747;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 818, 610, 610
                    , 610, 610, 610, 612.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+818, sellCostBuyPrice =sellCostBuyPrice+610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+612.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6747, '2024-11-05', 818, 610, 610
                    , 610, 610, 610, 612.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,230, 230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+818, sellCostBuyPrice =sellCostBuyPrice+610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+612.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 818, 610, 610
                    , 610, 610, 610, 612.5, 230, 230)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+818, netSellCostBuyPrice = netSellCostBuyPrice+610
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+610
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+610
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+610
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+610
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+612.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+230
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+230;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06729ec607d66f and sellbillId = 143215 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:12:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:42:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:42:39', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:12:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:42:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 13:42:54', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:12:56";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:42:56", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 13:42:56', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:13:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:43:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 13:43:04', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:13:50";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:43:50", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:43:50', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a04afa1f95
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8163,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:42:39', '0672a04afa1f95', '8163', '20.00', '298', '0', '1', '278.00', '278', '0', '278', '1', '2024-11-05 13:43:50', '', '75', '0', 'ماريه بسكالس T202', '2', '1', '3', '89', 'ماريه بسكالس T202', '3' ,'0','','','','','-1','0','0','0','0','0','278','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '298', userid = '75' WHERE clientid = '8163';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8163','20.00','278','0','اضافة فاتورة مبيعات','143216', '298', '2024-11-05 13:43:50', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '278', '0', null, '0', null, null,'', '0','1','1','278','1','2024-11-05 13:42:39','0','0');
UPDATE client SET  inUse = 0 where clientid = 8163;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 21231;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','0K412', '143216', '7', '9614', '1', '255', '255', '0', '', '1', '2024-11-05 13:43:51', '9614', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','21231-1,','1','1','0','0','255','255','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 192.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 192.00
        
                where sellbilldetailid = 523480;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9614, '2024-11-05', 255, 190, 190
                    , 192, 190, 192, 192.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+192
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+192
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+192.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 255, 190, 190
                    , 192, 190, 192, 192.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+192
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+192
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+192.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 13:43:51' WHERE storedetailid = '9613';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9614', '1', '1', '1', '143216', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 13:43:51','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143216', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:43:51', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143216', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 13:43:51', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 8163;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 278, 190, 190
                    , 192, 190, 192, 192.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+278, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+192
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+192
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+192.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8163, '2024-11-05', 278, 190, 190
                    , 192, 190, 192, 192.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+278, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+192
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+192
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+192.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 278, 190, 190
                    , 192, 190, 192, 192.5, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+278, netSellCostBuyPrice = netSellCostBuyPrice+190
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+190
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+192
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+190
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+192
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+192.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a04afa1f95 and sellbillId = 143216 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:13:51";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:43:51", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:43:51', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:15:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:45:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:45:13', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1461','','14','500','680', '680','680', '2024-11-05', '0', '77', '1', 'H1461', '0', '0', '0', '0', '0', '500','500','500','500','500','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','500','500','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15848, 1,'2024-11-05 13:45:39',77)
                ON DUPLICATE KEY UPDATE productid = 15848, edited = 1, sysdate = '2024-11-05 13:45:39', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15848', '1', '2024-11-05', '77', '0','1584801','680','680','680','500','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15848', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15848', '1', '0', '0', '15848', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('R3281','','1','430','510', '510','510', '2024-11-05', '0', '77', '1', 'R3281', '0', '0', '0', '0', '0', '430','430','430','430','430','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','430','430','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15849, 1,'2024-11-05 13:46:03',77)
                ON DUPLICATE KEY UPDATE productid = 15849, edited = 1, sysdate = '2024-11-05 13:46:03', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15849', '1', '2024-11-05', '77', '0','1584901','510','510','510','430','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15849', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15849', '1', '0', '0', '15849', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6951','','5','190','240', '240','240', '2024-11-05', '0', '77', '1', '06951', '0', '0', '0', '0', '0', '190','190','190','190','190','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','190','190','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15850, 1,'2024-11-05 13:46:21',77)
                ON DUPLICATE KEY UPDATE productid = 15850, edited = 1, sysdate = '2024-11-05 13:46:21', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15850', '1', '2024-11-05', '77', '0','1585001','240','240','240','190','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15850', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15850', '1', '0', '0', '15850', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1463','','14','800','1000', '1000','1000', '2024-11-05', '0', '77', '1', 'H1463', '0', '0', '0', '0', '0', '800','800','800','800','800','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','800','800','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15851, 1,'2024-11-05 13:46:50',77)
                ON DUPLICATE KEY UPDATE productid = 15851, edited = 1, sysdate = '2024-11-05 13:46:50', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15851', '1', '2024-11-05', '77', '0','1585101','1000','1000','1000','800','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15851', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15851', '1', '0', '0', '15851', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:16:57";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:46:57", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:46:57', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a0549c0d3d', '2024-11-05 13:45:13', '34', '88975.00', '113775', '0', '0', '24800',  '24800', '0', '24800', '1', '2024-11-05 13:46:58', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1461', '13606', '14', '15848', '15', '500', '7500', '0', '', '2024-11-05 13:46:58', '15848','','','0','0','0','0','0',null,'500','7500','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:45:13', 1, 15848, 0, 0
                    , 500, 15, 0, 0, 77, '2024-11-05 13:46:58')
                ON DUPLICATE KEY UPDATE buyprice = 500,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:46:58' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15848', '500', '15', '0', 'buyBillController.php', '31316', '', '0', '0');
UPDATE product SET  productBuyPrice = "500" WHERE productId = 15848 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31316 ;
UPDATE product SET productName = 'H1461', productDescription = '', productCatId = '14', productBuyPrice = '500.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1461',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='500',meanbuyprice_withTax='500',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='500'  WHERE productId = '15848';
UPDATE buybilldetail SET  lastbuyprice = 500 , meanbuyprice = 500, lastbuyprice_withDiscount = 500, meanbuyprice_withDiscount = 500
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where buybilldetailid = 31316;
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 15848;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15847';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15848', '1', '15', '0', '13606', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 13:45:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3281', '13606', '1', '15849', '15', '430', '6450', '0', '', '2024-11-05 13:46:58', '15849','','','0','0','0','0','0',null,'430','6450','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:45:13', 1, 15849, 0, 0
                    , 430, 15, 0, 0, 77, '2024-11-05 13:46:58')
                ON DUPLICATE KEY UPDATE buyprice = 430,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:46:58' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15849', '430', '15', '0', 'buyBillController.php', '31317', '', '0', '0');
UPDATE product SET  productBuyPrice = "430" WHERE productId = 15849 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31317 ;
UPDATE product SET productName = 'R3281', productDescription = '', productCatId = '1', productBuyPrice = '430.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3281',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430'  WHERE productId = '15849';
UPDATE buybilldetail SET  lastbuyprice = 430 , meanbuyprice = 430, lastbuyprice_withDiscount = 430, meanbuyprice_withDiscount = 430
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where buybilldetailid = 31317;
UPDATE productunit SET proUnitBuyPrice  = 430 * productnumber WHERE productid = 15849;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15848';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15849', '1', '15', '0', '13606', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 13:45:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06951', '13606', '5', '15850', '15', '190', '2850', '0', '', '2024-11-05 13:46:58', '15850','','','0','0','0','0','0',null,'190','2850','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:45:13', 1, 15850, 0, 0
                    , 190, 15, 0, 0, 77, '2024-11-05 13:46:58')
                ON DUPLICATE KEY UPDATE buyprice = 190,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:46:58' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15850', '190', '15', '0', 'buyBillController.php', '31318', '', '0', '0');
UPDATE product SET  productBuyPrice = "190" WHERE productId = 15850 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31318 ;
UPDATE product SET productName = '6951', productDescription = '', productCatId = '5', productBuyPrice = '190.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06951',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '190',meanbuyprice = '190',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='190',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='190'  WHERE productId = '15850';
UPDATE buybilldetail SET  lastbuyprice = 190 , meanbuyprice = 190, lastbuyprice_withDiscount = 190, meanbuyprice_withDiscount = 190
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where buybilldetailid = 31318;
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 15850;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15849';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15850', '1', '15', '0', '13606', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 13:45:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1463', '13606', '14', '15851', '10', '800', '8000', '0', '', '2024-11-05 13:46:58', '15851','','','0','0','0','0','0',null,'800','8000','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:45:13', 1, 15851, 0, 0
                    , 800, 10, 0, 0, 77, '2024-11-05 13:46:58')
                ON DUPLICATE KEY UPDATE buyprice = 800,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:46:58' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15851', '800', '10', '0', 'buyBillController.php', '31319', '', '0', '0');
UPDATE product SET  productBuyPrice = "800" WHERE productId = 15851 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31319 ;
UPDATE product SET productName = 'H1463', productDescription = '', productCatId = '14', productBuyPrice = '800.00', productSellAllPrice = '1000.00', productSellUnitPrice = '1000.00', productSellHalfPrice = '1000.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1463',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '800',lastbuyprice_withDiscount = '800',meanbuyprice = '800',meanbuyprice_withDiscount = '800' , productbuypricereal = '800.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='800',meanbuyprice_withTax='800',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='800'  WHERE productId = '15851';
UPDATE buybilldetail SET  lastbuyprice = 800 , meanbuyprice = 800, lastbuyprice_withDiscount = 800, meanbuyprice_withDiscount = 800
        , lastbuyprice_withTax = 800, meanbuyprice_withTax = 800, lastbuyprice_withDiscountAndTax = 800
                where buybilldetailid = 31319;
UPDATE productunit SET proUnitBuyPrice  = 800 * productnumber WHERE productid = 15851;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15850';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15851', '1', '10', '0', '13606', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '10', '77', '2024-11-05 13:45:13','0','0');
UPDATE supplier SET  suppliercurrentDebt = '113775',suppliercurrentDebtInCurrency= '113775' , userid = '77', supplierdate = '2024-11-05 13:46:58'   WHERE supplierid = '34';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('34', '88975.00', '24800', '0', 'اضافة فاتورة مشتريات', '13606', '113775', '2024-11-05 13:45:13', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','24800','1','88975','24800','113775','0');
update buybill set dailyentryid='0,' where buybillid=13606;
COMMIT;
UPDATE product SET overAllAveragePrice = 500 WHERE productId = 15848;UPDATE product SET overAllAveragePrice = 430 WHERE productId = 15849;UPDATE product SET overAllAveragePrice = 190 WHERE productId = 15850;UPDATE product SET overAllAveragePrice = 800 WHERE productId = 15851;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:16:58";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:46:58", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:46:58', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13606');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:17:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:47:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:47:04', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13606&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:17:53";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:47:53", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:47:53', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a04f8248b2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8766,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:43:52', '0672a04f8248b2', '8766', '-102.00', '1272', '0', '1', '1374.00', '1374', '0', '1374', '1', '2024-11-05 13:47:53', '', '75', '0', 'فادية عزت W4', '2', '1', '3', '83', 'فادية عزت W4', '9' ,'0','','','','','-1','0','0','0','0','0','1374','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1272', userid = '75' WHERE clientid = '8766';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8766','-102.00','1374','0','اضافة فاتورة مبيعات','143217', '1272', '2024-11-05 13:47:53', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1374', '0', null, '0', null, null,'', '0','1','1','1374','1','2024-11-05 13:43:52','0','0');
UPDATE client SET  inUse = 0 where clientid = 8766;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','06411', '143217', '5', '14582', '1', '165', '165', '0', '', '1', '2024-11-05 13:47:53', '14582', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 172.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 172.00
        
                where sellbilldetailid = 523483;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14582, '2024-11-05', 165, 170, 170
                    , 172, 170, 172, 172.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+172
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+172
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+172.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 170, 170
                    , 172, 170, 172, 172.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+172
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+172
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+172.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-2', userid = '75', storedetaildate = '2024-11-05 13:47:53' WHERE storedetailid = '14581';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14582', '1', '1', '1', '143217', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-1', '-2', '75', '2024-11-05 13:47:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26874;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('425','05442', '143217', '5', '11865', '1', '245', '245', '0', '', '1', '2024-11-05 13:47:53', '11865', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26874-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 425.00
        
                where sellbilldetailid = 523484;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11865, '2024-11-05', 245, 425, 425
                    , 425, 425, 425, 425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 245, 425, 425
                    , 425, 425, 425, 425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 13:47:53' WHERE storedetailid = '11864';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11865', '1', '1', '1', '143217', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 13:47:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29891;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','05911', '143217', '5', '13186', '1', '165', '165', '0', '', '1', '2024-11-05 13:47:53', '13186', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29891-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 880.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 880.00
        
                where sellbilldetailid = 523485;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13186, '2024-11-05', 165, 220, 220
                    , 880, 220, 880, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 220, 220
                    , 880, 220, 880, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 13:47:53' WHERE storedetailid = '13185';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13186', '1', '1', '1', '143217', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 13:47:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32700;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06435', '143217', '5', '14650', '1', '240', '240', '0', '', '1', '2024-11-05 13:47:53', '14650', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32700-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523486;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14650, '2024-11-05', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 13:47:53' WHERE storedetailid = '14649';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14650', '1', '1', '1', '143217', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 13:47:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 23724;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('480','53925', '143217', '5', '10889', '1', '190', '190', '0', '', '1', '2024-11-05 13:47:53', '10889', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','23724-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 1080.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 1080.00
        
                where sellbilldetailid = 523487;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10889, '2024-11-05', 190, 480, 480
                    , 1080, 480, 1080, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 480, 480
                    , 1080, 480, 1080, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 13:47:53' WHERE storedetailid = '10888';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10889', '1', '1', '1', '143217', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 13:47:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34060;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','R3173', '143217', '1', '15318', '1', '185', '185', '0', '', '1', '2024-11-05 13:47:53', '15318', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34060-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        , lastbuyprice_withTax = 135, meanbuyprice_withTax = 169, lastbuyprice_withDiscountAndTax = 135
                where sellbilldetailid = 523488;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15318, '2024-11-05', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 135, 169, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+169
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 135, 169, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+169
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 13:47:53' WHERE storedetailid = '15317';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15318', '1', '1', '1', '143217', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 13:47:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','عرض 150', '143217', '18', '10355', '1', '150', '150', '0', '', '1', '2024-11-05 13:47:53', '10355', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523489;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10355, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-51', userid = '75', storedetaildate = '2024-11-05 13:47:53' WHERE storedetailid = '10354';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10355', '1', '1', '1', '143217', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-50', '-51', '75', '2024-11-05 13:47:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143217', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:47:53', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143217', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-05 13:47:53', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 8766;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1374, 1815, 1815
                    , 3077, 1815, 3077, 1667.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,135, 169, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1374, sellCostBuyPrice =sellCostBuyPrice+1815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1815, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3077
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3077
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1667.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+169
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8766, '2024-11-05', 1374, 1815, 1815
                    , 3077, 1815, 3077, 1667.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,135, 169, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1374, sellCostBuyPrice =sellCostBuyPrice+1815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1815, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3077
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3077
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1667.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+135
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+169
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1374, 1815, 1815
                    , 3077, 1815, 3077, 1667.5, 135, 169)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1374, netSellCostBuyPrice = netSellCostBuyPrice+1815
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1815
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3077
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1815
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3077
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1667.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+135
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+169;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a04f8248b2 and sellbillId = 143217 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:17:54";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:47:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:47:54', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:19:25";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:49:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:49:25', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13606&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:19:29";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:49:29", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:49:29', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1462','','14','320','420', '420','420', '2024-11-05', '0', '77', '1', 'H1462', '0', '0', '0', '0', '0', '320','320','320','320','320','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','320','320','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15852, 1,'2024-11-05 13:49:59',77)
                ON DUPLICATE KEY UPDATE productid = 15852, edited = 1, sysdate = '2024-11-05 13:49:59', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15852', '1', '2024-11-05', '77', '0','1585201','420','420','420','320','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15852', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15852', '1', '0', '0', '15852', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:20:05";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:50:05", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:50:05', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a064a04307', '2024-11-05 13:49:30', '230', '14690.00', '19490', '0', '0', '4800',  '4800', '0', '4800', '1', '2024-11-05 13:50:05', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1462', '13607', '14', '15852', '15', '320', '4800', '0', '', '2024-11-05 13:50:05', '15852','','','0','0','0','0','0',null,'320','4800','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:49:30', 1, 15852, 0, 0
                    , 320, 15, 0, 0, 77, '2024-11-05 13:50:05')
                ON DUPLICATE KEY UPDATE buyprice = 320,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:50:05' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15852', '320', '15', '0', 'buyBillController.php', '31320', '', '0', '0');
UPDATE product SET  productBuyPrice = "320" WHERE productId = 15852 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31320 ;
UPDATE product SET productName = 'H1462', productDescription = '', productCatId = '14', productBuyPrice = '320.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1462',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='320',meanbuyprice_withTax='320',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='320'  WHERE productId = '15852';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 320, meanbuyprice_withDiscount = 320
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where buybilldetailid = 31320;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 15852;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15851';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15852', '1', '15', '0', '13607', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 13:49:30','0','0');
UPDATE supplier SET  suppliercurrentDebt = '19490',suppliercurrentDebtInCurrency= '19490' , userid = '77', supplierdate = '2024-11-05 13:50:05'   WHERE supplierid = '230';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('230', '14690.00', '4800', '0', 'اضافة فاتورة مشتريات', '13607', '19490', '2024-11-05 13:49:30', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','4800','1','14690','4800','19490','0');
update buybill set dailyentryid='0,' where buybillid=13607;
COMMIT;
UPDATE product SET overAllAveragePrice = 320 WHERE productId = 15852;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:20:05";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:50:05", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:50:05', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13607');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:20:10";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:50:10", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:50:10', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13607&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:20:17";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:50:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:50:17', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a05ea8af86
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9961,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:47:54', '0672a05ea8af86', '9961', '1374.00', '1697', '0', '1', '323.00', '323', '0', '323', '1', '2024-11-05 13:50:17', '', '75', '0', 'سارة رجب حسن 12', '2', '1', '3', '81', 'سارة رجب حسن 12', '2' ,'0','','','','','-1','0','0','0','0','0','323','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1697', userid = '75' WHERE clientid = '9961';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9961','1374.00','323','0','اضافة فاتورة مبيعات','143218', '1697', '2024-11-05 13:50:17', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '323', '0', null, '0', null, null,'', '0','1','1','323','1','2024-11-05 13:47:54','0','0');
UPDATE client SET  inUse = 0 where clientid = 9961;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34472;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265','R3258', '143218', '1', '15608', '1', '320', '320', '0', '', '1', '2024-11-05 13:50:17', '15608', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34472-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.00
        , lastbuyprice_withTax = 265, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 265
                where sellbilldetailid = 523492;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15608, '2024-11-05', 320, 265, 265
                    , 265, 265, 265, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 265, 265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 265, 265
                    , 265, 265, 265, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0, 265, 265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 13:50:17' WHERE storedetailid = '15607';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15608', '1', '1', '1', '143218', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 13:50:17','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143218', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 13:50:17', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 9961;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 323, 265, 265
                    , 265, 265, 265, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,265, 265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9961, '2024-11-05', 323, 265, 265
                    , 265, 265, 265, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,265, 265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 323, 265, 265
                    , 265, 265, 265, 265, 265, 265)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+323, netSellCostBuyPrice = netSellCostBuyPrice+265
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+265
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+265
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+265
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+265
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+265
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+265
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+265;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a05ea8af86 and sellbillId = 143218 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:20:18";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:50:18", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:50:18', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:21:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:51:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:51:13', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13607&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:21:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:51:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:51:15', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1464','','14','220','300', '300','300', '2024-11-05', '0', '77', '1', 'H1464', '0', '0', '0', '0', '0', '220','220','220','220','220','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','220','220','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15853, 1,'2024-11-05 13:51:41',77)
                ON DUPLICATE KEY UPDATE productid = 15853, edited = 1, sysdate = '2024-11-05 13:51:41', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15853', '1', '2024-11-05', '77', '0','1585301','300','300','300','220','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15853', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15853', '1', '0', '0', '15853', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:21:47";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:51:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:51:47', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:21:47";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:51:47", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:51:47', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a067a57271
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8855,@clientdebt,@clientname,@treeIdis);
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a06b3bc397', '2024-11-05 13:51:15', '9', '191535.00', '195935', '0', '0', '4400',  '4400', '0', '4400', '1', '2024-11-05 13:51:47', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1464', '13608', '14', '15853', '20', '220', '4400', '0', '', '2024-11-05 13:51:47', '15853','','','0','0','0','0','0',null,'220','4400','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:51:15', 1, 15853, 0, 0
                    , 220, 20, 0, 0, 77, '2024-11-05 13:51:47')
                ON DUPLICATE KEY UPDATE buyprice = 220,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:51:47' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15853', '220', '20', '0', 'buyBillController.php', '31321', '', '0', '0');
UPDATE product SET  productBuyPrice = "220" WHERE productId = 15853 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31321 ;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:50:18', '0672a067a57271', '8855', '0.00', '162', '0', '1', '162.00', '162', '0', '162', '1', '2024-11-05 13:51:47', '', '75', '0', 'صفا سعيد d40', '2', '1', '3', '81', 'صفا سعيد d40', '3' ,'0','','','','','-1','0','0','0','0','0','162','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '162', userid = '75' WHERE clientid = '8855';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8855','0.00','162','0','اضافة فاتورة مبيعات','143219', '162', '2024-11-05 13:51:47', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '162', '0', null, '0', null, null,'', '0','1','1','162','1','2024-11-05 13:50:18','0','0');
UPDATE client SET  inUse = 0 where clientid = 8855;
UPDATE product SET productName = 'H1464', productDescription = '', productCatId = '14', productBuyPrice = '220.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1464',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '220',lastbuyprice_withDiscount = '220',meanbuyprice = '220',meanbuyprice_withDiscount = '220' , productbuypricereal = '220.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='220',meanbuyprice_withTax='220',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='220'  WHERE productId = '15853';
UPDATE buybilldetail SET  lastbuyprice = 220 , meanbuyprice = 220, lastbuyprice_withDiscount = 220, meanbuyprice_withDiscount = 220
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where buybilldetailid = 31321;
UPDATE productunit SET proUnitBuyPrice  = 220 * productnumber WHERE productid = 15853;
UPDATE storedetail SET  productquantity = '20', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15852';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15853', '1', '20', '0', '13608', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '77', '2024-11-05 13:51:15','0','0');
UPDATE supplier SET  suppliercurrentDebt = '195935',suppliercurrentDebtInCurrency= '195935' , userid = '77', supplierdate = '2024-11-05 13:51:47'   WHERE supplierid = '9';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('9', '191535.00', '4400', '0', 'اضافة فاتورة مشتريات', '13608', '195935', '2024-11-05 13:51:15', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','4400','1','191535','4400','195935','0');
update buybill set dailyentryid='0,' where buybillid=13608;
COMMIT;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32486;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06154', '143219', '5', '13936', '1', '140', '140', '0', '', '1', '2024-11-05 13:51:47', '13936', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32486-1,','1','1','0','0','140','140','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 236.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 236.00
        
                where sellbilldetailid = 523494;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13936, '2024-11-05', 140, 150, 150
                    , 236, 150, 236, 146.43
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.43
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 140, 150, 150
                    , 236, 150, 236, 146.43
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.43
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-05 13:51:47' WHERE storedetailid = '13935';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13936', '1', '1', '1', '143219', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-05 13:51:47','0','0');
UPDATE product SET overAllAveragePrice = 220 WHERE productId = 15853;;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143219', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:51:47', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143219', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-05 13:51:47', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 8855;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 162, 150, 150
                    , 236, 150, 236, 146.43
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+162, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.43
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8855, '2024-11-05', 162, 150, 150
                    , 236, 150, 236, 146.43
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+162, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.43
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 162, 150, 150
                    , 236, 150, 236, 146.43, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+162, netSellCostBuyPrice = netSellCostBuyPrice+150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+150
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+236
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+150
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+236
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+146.43
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a067a57271 and sellbillId = 143219 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:21:48";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:51:48", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:51:48', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:21:48";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:51:48", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:51:48', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13608');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:21:51";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:51:51", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:51:51', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13608&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:22:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:52:20", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:52:20', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13608&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:22:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 13:52:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:52:23', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:22:25";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:52:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:52:25', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE userid = 2;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:22:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 13:52:42", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 13:52:42', '75', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:22:43";
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1465','','14','420','520', '520','520', '2024-11-05', '0', '77', '1', 'H1465', '0', '0', '0', '0', '0', '420','420','420','420','420','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','420','420','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15854, 1,'2024-11-05 13:52:46',77)
                ON DUPLICATE KEY UPDATE productid = 15854, edited = 1, sysdate = '2024-11-05 13:52:46', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15854', '1', '2024-11-05', '77', '0','1585401','520','520','520','420','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15854', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15854', '1', '0', '0', '15854', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:23:03";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:53:03", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:53:03', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a06fa1d33c', '2024-11-05 13:52:26', '7', '296310.00', '314560', '0', '0', '18250',  '18250', '0', '18250', '1', '2024-11-05 13:53:03', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1465', '13609', '14', '15854', '25', '420', '10500', '0', '', '2024-11-05 13:53:03', '15854','','','0','0','0','0','0',null,'420','10500','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:52:26', 1, 15854, 0, 0
                    , 420, 25, 0, 0, 77, '2024-11-05 13:53:03')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+25, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:53:03' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15854', '420', '25', '0', 'buyBillController.php', '31322', '', '0', '0');
UPDATE product SET  productBuyPrice = "420" WHERE productId = 15854 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31322 ;
UPDATE product SET productName = 'H1465', productDescription = '', productCatId = '14', productBuyPrice = '420.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1465',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '420',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420'  WHERE productId = '15854';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 31322;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 15854;
UPDATE storedetail SET  productquantity = '25', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15853';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15854', '1', '25', '0', '13609', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '25', '77', '2024-11-05 13:52:26','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1377', '13609', '14', '15585', '25', '310', '7750', '0', '', '2024-11-05 13:53:03', '15585','','','0','0','0','0','0',null,'310','7750','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:52:26', 1, 15585, 0, 0
                    , 310, 25, 0, 0, 77, '2024-11-05 13:53:03')
                ON DUPLICATE KEY UPDATE buyprice = 310,
                        buyQuantity =buyQuantity+25, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:53:03' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15585', '310', '25', '0', 'buyBillController.php', '31323', '', '0', '0');
UPDATE product SET  productBuyPrice = "310" WHERE productId = 15585 ;
UPDATE buybilldetail SET  quantitybefore = 38 WHERE buybilldetailid = 31323 ;
UPDATE product SET productName = 'H1377', productDescription = '', productCatId = '14', productBuyPrice = '310.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1377',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '310',lastbuyprice_withDiscount = '310',meanbuyprice = '299',meanbuyprice_withDiscount = '299' , productbuypricereal = '280.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='291.05',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='310',meanbuyprice_withTax='264',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='310'  WHERE productId = '15585';
UPDATE buybilldetail SET  lastbuyprice = 310 , meanbuyprice = 299, lastbuyprice_withDiscount = 310, meanbuyprice_withDiscount = 299
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 264, lastbuyprice_withDiscountAndTax = 310
                where buybilldetailid = 31323;
UPDATE productunit SET proUnitBuyPrice  = 310 * productnumber WHERE productid = 15585;
UPDATE storedetail SET  productquantity = '63', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15584';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15585', '1', '25', '0', '13609', 'اضافة فاتورة مشتريات', 'buyBillController.php', '38', '63', '77', '2024-11-05 13:52:26','0','0');
UPDATE supplier SET  suppliercurrentDebt = '314560',suppliercurrentDebtInCurrency= '314560' , userid = '77', supplierdate = '2024-11-05 13:53:03'   WHERE supplierid = '7';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('7', '296310.00', '18250', '0', 'اضافة فاتورة مشتريات', '13609', '314560', '2024-11-05 13:52:26', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','18250','1','296310','18250','314560','0');
update buybill set dailyentryid='0,' where buybillid=13609;
COMMIT;
UPDATE product SET overAllAveragePrice = 302 WHERE productId = 15585;UPDATE product SET overAllAveragePrice = 420 WHERE productId = 15854;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:23:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:53:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:53:04', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13609');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:23:07";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:53:07", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:53:07', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13609&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:23:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:53:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:53:16', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a03c6f2949
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:38:46', '0672a03c6f2949', '1', '0.00', '0', '0', '1', '3240.00', '3240', '3240', '0', '1', '2024-11-05 13:53:16', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','3240','0','','0','0','3240','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143220', '0', '2024-11-05 13:53:16', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3240', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:38:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('700','H1337', '143220', '14', '15406', '1', '870', '870', '0', '', '1', '2024-11-05 13:53:16', '15406', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34131-1,','1','1','0','0','870','870','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        
                where sellbilldetailid = 523497;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15406, '2024-11-05', 870, 700, 700
                    , 700, 700, 700, 700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+870, sellCostBuyPrice =sellCostBuyPrice+700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 870, 700, 700
                    , 700, 700, 700, 700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+870, sellCostBuyPrice =sellCostBuyPrice+700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-05 13:53:16' WHERE storedetailid = '15405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15406', '1', '1', '1', '143220', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-05 13:53:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34452;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','H1386', '143220', '14', '15592', '1', '510', '510', '0', '', '1', '2024-11-05 13:53:16', '15592', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34452-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 523498;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15592, '2024-11-05', 510, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 510, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-05 13:53:16' WHERE storedetailid = '15591';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15592', '1', '1', '1', '143220', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-05 13:53:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34638;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06848', '143220', '5', '15577', '1', '380', '380', '0', '', '1', '2024-11-05 13:53:16', '15577', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34638-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 523499;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15577, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 13:53:16' WHERE storedetailid = '15576';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15577', '1', '1', '1', '143220', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 13:53:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34133;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','H1336', '143220', '14', '15408', '1', '850', '850', '0', '', '1', '2024-11-05 13:53:16', '15408', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34133-1,','1','1','0','0','850','850','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        
                where sellbilldetailid = 523500;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15408, '2024-11-05', 850, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+850, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 850, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+850, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 13:53:16' WHERE storedetailid = '15407';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15408', '1', '1', '1', '143220', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 13:53:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34705;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('560','H1431', '143220', '14', '15751', '1', '630', '630', '0', '', '1', '2024-11-05 13:53:16', '15751', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34705-1,','1','1','0','0','630','630','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 560.00, meanbuyprice_withDiscount = 560.00
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 560
                where sellbilldetailid = 523501;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15751, '2024-11-05', 630, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 560, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 630, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 560, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 13:53:16' WHERE storedetailid = '15750';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15751', '1', '1', '1', '143220', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 13:53:16','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '22115',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('18875','3240', '0', '1', 'اضافة فاتورة مبيعات', '143220', '22115', '2024-11-05 13:53:16', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 3240, 2580, 2580
                    , 2580, 2580, 2580, 2580
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1280, 1145, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, sellCostBuyPrice =sellCostBuyPrice+2580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2580
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1145
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 3240, 2580, 2580
                    , 2580, 2580, 2580, 2580
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1280, 1145, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, sellCostBuyPrice =sellCostBuyPrice+2580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2580
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1145
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3240, 2580, 2580
                    , 2580, 2580, 2580, 2580, 1280, 1145)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3240, netSellCostBuyPrice = netSellCostBuyPrice+2580
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2580
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2580
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2580
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2580
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2580
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1280
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1145;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a03c6f2949 and sellbillId = 143220 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:23:17";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:53:17", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:53:17', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13609&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:23:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:53:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:53:17', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:23:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 13:53:18", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:53:18', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:23:31";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:53:31", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:53:31', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6958','','5','145','200', '200','200', '2024-11-05', '0', '77', '1', '06958', '0', '0', '0', '0', '0', '145','145','145','145','145','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','145','145','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15855, 1,'2024-11-05 13:53:54',77)
                ON DUPLICATE KEY UPDATE productid = 15855, edited = 1, sysdate = '2024-11-05 13:53:54', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15855', '1', '2024-11-05', '77', '0','1585501','200','200','200','145','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15855', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15855', '1', '0', '0', '15855', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6959','','5','140','200', '200','200', '2024-11-05', '0', '77', '1', '06959', '0', '0', '0', '0', '0', '140','140','140','140','140','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','140','140','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15856, 1,'2024-11-05 13:54:39',77)
                ON DUPLICATE KEY UPDATE productid = 15856, edited = 1, sysdate = '2024-11-05 13:54:39', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15856', '1', '2024-11-05', '77', '0','1585601','200','200','200','140','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15856', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15856', '1', '0', '0', '15856', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6957','','5','290','360', '360','360', '2024-11-05', '0', '77', '1', '06957', '0', '0', '0', '0', '0', '290','290','290','290','290','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','290','290','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15857, 1,'2024-11-05 13:55:07',77)
                ON DUPLICATE KEY UPDATE productid = 15857, edited = 1, sysdate = '2024-11-05 13:55:07', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15857', '1', '2024-11-05', '77', '0','1585701','360','360','360','290','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15857', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15857', '1', '0', '0', '15857', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6955','','5','290','350', '350','350', '2024-11-05', '0', '77', '1', '06955', '0', '0', '0', '0', '0', '290','290','290','290','290','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','290','290','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15858, 1,'2024-11-05 13:55:27',77)
                ON DUPLICATE KEY UPDATE productid = 15858, edited = 1, sysdate = '2024-11-05 13:55:27', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15858', '1', '2024-11-05', '77', '0','1585801','350','350','350','290','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15858', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15858', '1', '0', '0', '15858', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:25:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 13:55:27", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:55:27', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a072e39a58
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(161,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:53:18', '0672a072e39a58', '161', '-4.00', '369', '0', '1', '373.00', '373', '0', '373', '1', '2024-11-05 13:55:27', '', '75', '0', 'ميرنا محسن', '2', '1', '3', '88', 'ميرنا محسن', '3' ,'0','','','','','-1','0','0','0','0','0','373','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '369', userid = '75' WHERE clientid = '161';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('161','-4.00','373','0','اضافة فاتورة مبيعات','143221', '369', '2024-11-05 13:55:27', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '373', '0', null, '0', null, null,'', '0','1','1','373','1','2024-11-05 13:53:18','0','0');
UPDATE client SET  inUse = 0 where clientid = 161;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33191;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','06581', '143221', '5', '15004', '1', '350', '350', '0', '', '1', '2024-11-05 13:55:27', '15004', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33191-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 523502;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15004, '2024-11-05', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 13:55:27' WHERE storedetailid = '15003';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15004', '1', '1', '1', '143221', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 13:55:27','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143221', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:55:27', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143221', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 13:55:28', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 161;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 373, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+373, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (161, '2024-11-05', 373, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+373, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 373, 300, 300
                    , 300, 300, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+373, netSellCostBuyPrice = netSellCostBuyPrice+300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a072e39a58 and sellbillId = 143221 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:25:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 13:55:28", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:55:28', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6960','','5','290','350', '350','350', '2024-11-05', '0', '77', '1', '06960', '0', '0', '0', '0', '0', '290','290','290','290','290','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','290','290','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15859, 1,'2024-11-05 13:55:43',77)
                ON DUPLICATE KEY UPDATE productid = 15859, edited = 1, sysdate = '2024-11-05 13:55:43', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15859', '1', '2024-11-05', '77', '0','1585901','350','350','350','290','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15859', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15859', '1', '0', '0', '15859', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE productunit SET unitid = '1', productid = '15757', productnumber = '1.00', productunitdate = '2024-10-29', userid = '77', conditions = '0',proUnitParcode='1575701',proUnitSellAllPrice='340',proUnitSellHalfPrice='340',proUnitSellUnitPrice ='340',proUnitBuyPrice='285',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15757';
UPDATE product SET productName = '6913', productDescription = '', productCatId = '5', productBuyPrice = '280', productSellAllPrice = '340', productSellUnitPrice = '340', productSellHalfPrice = '340', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = '06913',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '285.00',lastbuyprice_withDiscount = '285',meanbuyprice = '282.5',meanbuyprice_withDiscount = '282.5' , productbuypricereal = '285' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='285',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='285',meanbuyprice_withTax='285',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='285'  WHERE productId = '15757';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:26:36";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:56:36", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:56:36', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a06d4719d5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(235,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:51:48', '0672a06d4719d5', '235', '0.00', '1576', '0', '1', '1576.00', '1576', '0', '1576', '1', '2024-11-05 13:56:36', '', '75', '0', 'لمياء حداد i71', '2', '1', '3', '81', 'لمياء حداد i71', '9' ,'0','','','','','-1','0','0','0','0','0','1576','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1576', userid = '75' WHERE clientid = '235';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('235','0.00','1576','0','اضافة فاتورة مبيعات','143222', '1576', '2024-11-05 13:56:36', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1576', '0', null, '0', null, null,'', '0','1','1','1576','1','2024-11-05 13:51:48','0','0');
UPDATE client SET  inUse = 0 where clientid = 235;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34435;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06311', '143222', '5', '14358', '1', '120', '120', '0', '', '1', '2024-11-05 13:56:36', '14358', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34435-1,','1','1','0','0','120','120','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523505;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14358, '2024-11-05', 120, 150, 150
                    , 150, 150, 150, 148.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+148.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 120, 150, 150
                    , 150, 150, 150, 148.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+148.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 13:56:36' WHERE storedetailid = '14357';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14358', '1', '1', '1', '143222', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 13:56:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32480;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06416', '143222', '5', '14610', '1', '145', '145', '0', '', '1', '2024-11-05 13:56:36', '14610', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32480-1,','1','1','0','0','145','145','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523506;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14610, '2024-11-05', 145, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 145, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 13:56:36' WHERE storedetailid = '14609';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14610', '1', '1', '1', '143222', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 13:56:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 30203;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2707', '143222', '1', '13267', '3', '290', '870', '0', '', '1', '2024-11-05 13:56:37', '13267', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30203-3,','1','1','0','0','290','870','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523507;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13267, '2024-11-05', 870, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+870, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 870, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+870, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 13:56:37' WHERE storedetailid = '13266';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13267', '1', '3', '1', '143222', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '5', '75', '2024-11-05 13:56:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32514;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06430', '143222', '5', '14635', '1', '210', '210', '0', '', '1', '2024-11-05 13:56:37', '14635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32514-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523508;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14635, '2024-11-05', 210, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 13:56:37' WHERE storedetailid = '14634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14635', '1', '1', '1', '143222', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 13:56:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29501;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','R2689', '143222', '1', '13192', '1', '195', '195', '0', '', '1', '2024-11-05 13:56:37', '13192', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29501-1,','1','1','0','0','195','195','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        
                where sellbilldetailid = 523509;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13192, '2024-11-05', 195, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 195, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 13:56:37' WHERE storedetailid = '13191';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13192', '1', '1', '1', '143222', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 13:56:37','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143222', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 13:56:37', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143222', '17', '10291', '1', '16', '16', '0', '', '1', '2024-11-05 13:56:37', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16','16','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 235;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1576, 1440, 1440
                    , 1440, 1440, 1440, 1438.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1576, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1438.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (235, '2024-11-05', 1576, 1440, 1440
                    , 1440, 1440, 1440, 1438.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1576, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1438.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1576, 1440, 1440
                    , 1440, 1440, 1440, 1438.75, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1576, netSellCostBuyPrice = netSellCostBuyPrice+1440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1440
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1440
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1438.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a06d4719d5 and sellbillId = 143222 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:26:37";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 13:56:37", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:56:37', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET unitid = '1', productid = '15820', productnumber = '1.00', productunitdate = '2024-11-01', userid = '77', conditions = '0',proUnitParcode='1582001',proUnitSellAllPrice='200',proUnitSellHalfPrice='200',proUnitSellUnitPrice ='200',proUnitBuyPrice='145',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15820';
UPDATE product SET productName = '6934', productDescription = '', productCatId = '5', productBuyPrice = '140', productSellAllPrice = '200', productSellUnitPrice = '200', productSellHalfPrice = '200', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06934',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '145.00',lastbuyprice_withDiscount = '145',meanbuyprice = '142.5',meanbuyprice_withDiscount = '142.5' , productbuypricereal = '145' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='145',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='145',meanbuyprice_withTax='145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='145'  WHERE productId = '15820';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:27:07";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:57:07", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:57:07', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a073c0583f', '2024-11-05 13:53:32', '19', '165545.00', '216700', '0', '0', '51155',  '51155', '0', '51155', '1', '2024-11-05 13:57:07', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06958', '13610', '5', '15855', '15', '145', '2175', '0', '', '2024-11-05 13:57:07', '15855','','','0','0','0','0','0',null,'145','2175','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15855, 0, 0
                    , 145, 15, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 145,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15855', '145', '15', '0', 'buyBillController.php', '31324', '', '0', '0');
UPDATE product SET  productBuyPrice = "145" WHERE productId = 15855 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31324 ;
UPDATE product SET productName = '6958', productDescription = '', productCatId = '5', productBuyPrice = '145.00', productSellAllPrice = '200.00', productSellUnitPrice = '200.00', productSellHalfPrice = '200.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06958',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '145',lastbuyprice_withDiscount = '145',meanbuyprice = '145',meanbuyprice_withDiscount = '145' , productbuypricereal = '145.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='145',meanbuyprice_withTax='145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='145'  WHERE productId = '15855';
UPDATE buybilldetail SET  lastbuyprice = 145 , meanbuyprice = 145, lastbuyprice_withDiscount = 145, meanbuyprice_withDiscount = 145
        , lastbuyprice_withTax = 145, meanbuyprice_withTax = 145, lastbuyprice_withDiscountAndTax = 145
                where buybilldetailid = 31324;
UPDATE productunit SET proUnitBuyPrice  = 145 * productnumber WHERE productid = 15855;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15854';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15855', '1', '15', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06913', '13610', '5', '15757', '20', '280', '5600', '0', '', '2024-11-05 13:57:07', '15757','','','0','0','0','0','0',null,'280','5600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15757, 0, 0
                    , 280, 20, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 280,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15757', '280', '20', '0', 'buyBillController.php', '31325', '', '0', '0');
UPDATE product SET  productBuyPrice = "280" WHERE productId = 15757 ;
UPDATE buybilldetail SET  quantitybefore = 16 WHERE buybilldetailid = 31325 ;
UPDATE product SET productName = '6913', productDescription = '', productCatId = '5', productBuyPrice = '280.00', productSellAllPrice = '340.00', productSellUnitPrice = '340.00', productSellHalfPrice = '340.00', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = '06913',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '280',lastbuyprice_withDiscount = '280',meanbuyprice = '281',meanbuyprice_withDiscount = '281' , productbuypricereal = '285.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='285',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='280',meanbuyprice_withTax='282',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='280'  WHERE productId = '15757';
UPDATE buybilldetail SET  lastbuyprice = 280 , meanbuyprice = 281, lastbuyprice_withDiscount = 280, meanbuyprice_withDiscount = 281
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 282, lastbuyprice_withDiscountAndTax = 280
                where buybilldetailid = 31325;
UPDATE productunit SET proUnitBuyPrice  = 280 * productnumber WHERE productid = 15757;
UPDATE storedetail SET  productquantity = '36', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15756';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15757', '1', '20', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '16', '36', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06944', '13610', '5', '15819', '30', '420', '12600', '0', '', '2024-11-05 13:57:07', '15819','','','0','0','0','0','0',null,'420','12600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15819, 0, 0
                    , 420, 30, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15819', '420', '30', '0', 'buyBillController.php', '31326', '', '0', '0');
UPDATE product SET  productBuyPrice = "420" WHERE productId = 15819 ;
UPDATE buybilldetail SET  quantitybefore = 23 WHERE buybilldetailid = 31326 ;
UPDATE product SET productName = '6944', productDescription = '', productCatId = '5', productBuyPrice = '420.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06944',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '420',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420'  WHERE productId = '15819';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 31326;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 15819;
UPDATE storedetail SET  productquantity = '53', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '30', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '23', '53', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06934', '13610', '5', '15820', '15', '140', '2100', '0', '', '2024-11-05 13:57:07', '15820','','','0','0','0','0','0',null,'140','2100','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15820, 0, 0
                    , 140, 15, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 140,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15820', '140', '15', '0', 'buyBillController.php', '31327', '', '0', '0');
UPDATE product SET  productBuyPrice = "140" WHERE productId = 15820 ;
UPDATE buybilldetail SET  quantitybefore = 12 WHERE buybilldetailid = 31327 ;
UPDATE product SET productName = '6934', productDescription = '', productCatId = '5', productBuyPrice = '140.00', productSellAllPrice = '200.00', productSellUnitPrice = '200.00', productSellHalfPrice = '200.00', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06934',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '141',meanbuyprice_withDiscount = '141' , productbuypricereal = '145.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='145',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='140',meanbuyprice_withTax='142',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='140'  WHERE productId = '15820';
UPDATE buybilldetail SET  lastbuyprice = 140 , meanbuyprice = 141, lastbuyprice_withDiscount = 140, meanbuyprice_withDiscount = 141
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 142, lastbuyprice_withDiscountAndTax = 140
                where buybilldetailid = 31327;
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 15820;
UPDATE storedetail SET  productquantity = '27', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15819';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15820', '1', '15', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '12', '27', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06959', '13610', '5', '15856', '15', '140', '2100', '0', '', '2024-11-05 13:57:07', '15856','','','0','0','0','0','0',null,'140','2100','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15856, 0, 0
                    , 140, 15, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 140,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15856', '140', '15', '0', 'buyBillController.php', '31328', '', '0', '0');
UPDATE product SET  productBuyPrice = "140" WHERE productId = 15856 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31328 ;
UPDATE product SET productName = '6959', productDescription = '', productCatId = '5', productBuyPrice = '140.00', productSellAllPrice = '200.00', productSellUnitPrice = '200.00', productSellHalfPrice = '200.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06959',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '140',meanbuyprice_withDiscount = '140' , productbuypricereal = '140.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='140',meanbuyprice_withTax='140',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='140'  WHERE productId = '15856';
UPDATE buybilldetail SET  lastbuyprice = 140 , meanbuyprice = 140, lastbuyprice_withDiscount = 140, meanbuyprice_withDiscount = 140
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where buybilldetailid = 31328;
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 15856;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15855';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15856', '1', '15', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06419', '13610', '5', '14600', '15', '140', '2100', '0', '', '2024-11-05 13:57:07', '14600','','','0','0','0','0','0',null,'140','2100','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 14600, 0, 0
                    , 140, 15, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 140,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('14600', '140', '15', '0', 'buyBillController.php', '31329', '', '0', '0');
UPDATE product SET  productBuyPrice = "140" WHERE productId = 14600 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31329 ;
UPDATE product SET productName = '6419', productDescription = '', productCatId = '5', productBuyPrice = '140.00', productSellAllPrice = '190.00', productSellUnitPrice = '190.00', productSellHalfPrice = '190.00', productDate = '2024-08-27', conditions = '0', userId = '77', limitamount = '1', parcode = '06419',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '140',meanbuyprice_withDiscount = '140' , productbuypricereal = '140.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='140.91',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='140',meanbuyprice_withTax='140',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='140'  WHERE productId = '14600';
UPDATE buybilldetail SET  lastbuyprice = 140 , meanbuyprice = 140, lastbuyprice_withDiscount = 140, meanbuyprice_withDiscount = 140
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where buybilldetailid = 31329;
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 14600;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '14599';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14600', '1', '15', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06957', '13610', '5', '15857', '24', '290', '6960', '0', '', '2024-11-05 13:57:07', '15857','','','0','0','0','0','0',null,'290','6960','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15857, 0, 0
                    , 290, 24, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 290,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15857', '290', '24', '0', 'buyBillController.php', '31330', '', '0', '0');
UPDATE product SET  productBuyPrice = "290" WHERE productId = 15857 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31330 ;
UPDATE product SET productName = '6957', productDescription = '', productCatId = '5', productBuyPrice = '290.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='290',meanbuyprice_withTax='290',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='290'  WHERE productId = '15857';
UPDATE buybilldetail SET  lastbuyprice = 290 , meanbuyprice = 290, lastbuyprice_withDiscount = 290, meanbuyprice_withDiscount = 290
        , lastbuyprice_withTax = 290, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 290
                where buybilldetailid = 31330;
UPDATE productunit SET proUnitBuyPrice  = 290 * productnumber WHERE productid = 15857;
UPDATE storedetail SET  productquantity = '24', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15857', '1', '24', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06955', '13610', '5', '15858', '24', '290', '6960', '0', '', '2024-11-05 13:57:07', '15858','','','0','0','0','0','0',null,'290','6960','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15858, 0, 0
                    , 290, 24, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 290,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15858', '290', '24', '0', 'buyBillController.php', '31331', '', '0', '0');
UPDATE product SET  productBuyPrice = "290" WHERE productId = 15858 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31331 ;
UPDATE product SET productName = '6955', productDescription = '', productCatId = '5', productBuyPrice = '290.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06955',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='290',meanbuyprice_withTax='290',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='290'  WHERE productId = '15858';
UPDATE buybilldetail SET  lastbuyprice = 290 , meanbuyprice = 290, lastbuyprice_withDiscount = 290, meanbuyprice_withDiscount = 290
        , lastbuyprice_withTax = 290, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 290
                where buybilldetailid = 31331;
UPDATE productunit SET proUnitBuyPrice  = 290 * productnumber WHERE productid = 15858;
UPDATE storedetail SET  productquantity = '24', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15857';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15858', '1', '24', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06960', '13610', '5', '15859', '24', '290', '6960', '0', '', '2024-11-05 13:57:07', '15859','','','0','0','0','0','0',null,'290','6960','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15859, 0, 0
                    , 290, 24, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 290,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15859', '290', '24', '0', 'buyBillController.php', '31332', '', '0', '0');
UPDATE product SET  productBuyPrice = "290" WHERE productId = 15859 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31332 ;
UPDATE product SET productName = '6960', productDescription = '', productCatId = '5', productBuyPrice = '290.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06960',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='290',meanbuyprice_withTax='290',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='290'  WHERE productId = '15859';
UPDATE buybilldetail SET  lastbuyprice = 290 , meanbuyprice = 290, lastbuyprice_withDiscount = 290, meanbuyprice_withDiscount = 290
        , lastbuyprice_withTax = 290, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 290
                where buybilldetailid = 31332;
UPDATE productunit SET proUnitBuyPrice  = 290 * productnumber WHERE productid = 15859;
UPDATE storedetail SET  productquantity = '24', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15858';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15859', '1', '24', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '77', '2024-11-05 13:53:32','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06901', '13610', '5', '15736', '10', '360', '3600', '0', '', '2024-11-05 13:57:07', '15736','','','0','0','0','0','0',null,'360','3600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 13:53:32', 1, 15736, 0, 0
                    , 360, 10, 0, 0, 77, '2024-11-05 13:57:07')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 13:57:07' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15736', '360', '10', '0', 'buyBillController.php', '31333', '', '0', '0');
UPDATE product SET  productBuyPrice = "360" WHERE productId = 15736 ;
UPDATE buybilldetail SET  quantitybefore = 22 WHERE buybilldetailid = 31333 ;
UPDATE product SET productName = '6901', productDescription = '', productCatId = '5', productBuyPrice = '360.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = '06901',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='360',meanbuyprice_withTax='360',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360'  WHERE productId = '15736';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 31333;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 15736;
UPDATE storedetail SET  productquantity = '32', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '10', '0', '13610', 'اضافة فاتورة مشتريات', 'buyBillController.php', '22', '32', '77', '2024-11-05 13:53:32','0','0');
UPDATE supplier SET  suppliercurrentDebt = '216700',suppliercurrentDebtInCurrency= '216700' , userid = '77', supplierdate = '2024-11-05 13:57:07'   WHERE supplierid = '19';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('19', '165545.00', '51155', '0', 'اضافة فاتورة مشتريات', '13610', '216700', '2024-11-05 13:53:32', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','51155','1','165545','51155','216700','0');
update buybill set dailyentryid='0,' where buybillid=13610;
COMMIT;
UPDATE product SET overAllAveragePrice = 140.83 WHERE productId = 14600;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 15736;UPDATE product SET overAllAveragePrice = 282.5 WHERE productId = 15757;UPDATE product SET overAllAveragePrice = 420 WHERE productId = 15819;UPDATE product SET overAllAveragePrice = 142.5 WHERE productId = 15820;UPDATE product SET overAllAveragePrice = 145 WHERE productId = 15855;UPDATE product SET overAllAveragePrice = 140 WHERE productId = 15856;UPDATE product SET overAllAveragePrice = 290 WHERE productId = 15857;UPDATE product SET overAllAveragePrice = 290 WHERE productId = 15858;UPDATE product SET overAllAveragePrice = 290 WHERE productId = 15859;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:27:08";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:57:08", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 13:57:08', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13610');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:27:11";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:57:11", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:57:11', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13610&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:27:40";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 13:57:40", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 13:57:40', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:29:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:59:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:59:45', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a072d8cc8c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:53:17', '0672a072d8cc8c', '1', '0.00', '0', '0', '1', '300.00', '300', '300', '0', '1', '2024-11-05 13:59:45', '', '9', '0', 'نقدي', '1', '0', '3', '21', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','300','0','','0','0','300','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143223', '0', '2024-11-05 13:59:45', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:53:17','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R3261', '143223', '1', '15618', '1', '300', '300', '0', '', '1', '2024-11-05 13:59:45', '15618', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523512;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15618, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-8', userid = '9', storedetaildate = '2024-11-05 13:59:45' WHERE storedetailid = '15617';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15618', '1', '1', '1', '143223', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-7', '-8', '9', '2024-11-05 13:59:45','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '22415',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('22115','300', '0', '1', 'اضافة فاتورة مبيعات', '143223', '22415', '2024-11-05 13:59:46', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 21 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 300, 240, 240
                    , 240, 240, 240, 240, 240, 240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+300, netSellCostBuyPrice = netSellCostBuyPrice+240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a072d8cc8c and sellbillId = 143223 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:29:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 13:59:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 13:59:46', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:30:16";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:00:16", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 14:00:16', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:30:18";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:00:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:00:18', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:30:32";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:00:32", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:00:32', '75', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE userid = 75;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:30:46";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:00:46", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:00:46', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a07f618a49
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7055,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:56:38', '0672a07f618a49', '7055', '16.00', '1652', '0', '1', '1636.00', '1636', '0', '1636', '1', '2024-11-05 14:00:46', '', '75', '0', 'مصطفي ابراهيم U43', '2', '1', '3', '91', 'مصطفي ابراهيم U43', '7' ,'0','','','','','-1','0','0','0','0','0','1636','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1652', userid = '75' WHERE clientid = '7055';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7055','16.00','1636','0','اضافة فاتورة مبيعات','143224', '1652', '2024-11-05 14:00:46', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1636', '0', null, '0', null, null,'', '0','1','1','1636','1','2024-11-05 13:56:38','0','0');
UPDATE client SET  inUse = 0 where clientid = 7055;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34492;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143224', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-05 14:00:46', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34492-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 179, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523513;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 179, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+179
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-05 14:00:46' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143224', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-05 14:00:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34121;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3201', '143224', '1', '15401', '1', '300', '300', '0', '', '1', '2024-11-05 14:00:46', '15401', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34121-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 256.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 256.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 19, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523514;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15401, '2024-11-05', 300, 250, 260
                    , 256, 260, 256, 256
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 19, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+256
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+256
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 250, 260
                    , 256, 260, 256, 256
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 19, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+256
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+256
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+256
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 14:00:46' WHERE storedetailid = '15400';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15401', '1', '1', '1', '143224', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 14:00:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34756;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3274', '143224', '1', '15781', '1', '350', '350', '0', '', '1', '2024-11-05 14:00:46', '15781', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34756-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523515;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15781, '2024-11-05', 350, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '75', storedetaildate = '2024-11-05 14:00:46' WHERE storedetailid = '15780';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15781', '1', '1', '1', '143224', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '75', '2024-11-05 14:00:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34339;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','H1308', '143224', '14', '15393', '1', '475', '475', '0', '', '1', '2024-11-05 14:00:46', '15393', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34339-1,','1','1','0','0','475','475','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 523516;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15393, '2024-11-05', 475, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+475, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 475, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+475, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 14:00:46' WHERE storedetailid = '15392';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15393', '1', '1', '1', '143224', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 14:00:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30665;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','R2777', '143224', '1', '13789', '1', '185', '185', '0', '', '1', '2024-11-05 14:00:46', '13789', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30665-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523517;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13789, '2024-11-05', 185, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 14:00:46' WHERE storedetailid = '13788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13789', '1', '1', '1', '143224', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 14:00:46','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143224', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:00:46', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143224', '17', '10291', '1', '16', '16', '0', '', '1', '2024-11-05 14:00:46', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16','16','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 7055;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1636, 1265, 1275
                    , 1271, 1275, 1271, 1271
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,750, 448, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1636, sellCostBuyPrice =sellCostBuyPrice+1265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1271
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1271
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1271
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+448
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7055, '2024-11-05', 1636, 1265, 1275
                    , 1271, 1275, 1271, 1271
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,750, 448, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1636, sellCostBuyPrice =sellCostBuyPrice+1265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1271
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1271
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1271
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+448
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1636, 1265, 1275
                    , 1271, 1275, 1271, 1271, 750, 448)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1636, netSellCostBuyPrice = netSellCostBuyPrice+1265
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1275
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1271
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1275
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1271
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1271
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+750
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+448;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a07f618a49 and sellbillId = 143224 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:30:47";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:00:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:00:47', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:31:00";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:01:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 14:01:00', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:31:01";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:31:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:01:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 14:01:06', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE productunit SET unitid = '1', productid = '15038', productnumber = '1.00', productunitdate = '2024-09-14', userid = '77', conditions = '0',proUnitParcode='1503801',proUnitSellAllPrice='300',proUnitSellHalfPrice='300',proUnitSellUnitPrice ='300',proUnitBuyPrice='240',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15038';
UPDATE product SET productName = '6603', productDescription = '', productCatId = '5', productBuyPrice = '230', productSellAllPrice = '290', productSellUnitPrice = '290', productSellHalfPrice = '290', productDate = '2024-09-14', conditions = '0', userId = '77', limitamount = '0', parcode = '06603',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240.00',lastbuyprice_withDiscount = '240',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '230' , buypricereal_precentage = '0' , buytotal_precentage = '25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='179',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15038';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:31:34";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:01:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 14:01:34', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE productunit SET unitid = '1', productid = '15038', productnumber = '1.00', productunitdate = '2024-09-14', userid = '77', conditions = '0',proUnitParcode='1503801',proUnitSellAllPrice='300',proUnitSellHalfPrice='300',proUnitSellUnitPrice ='300',proUnitBuyPrice='240',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15038';
UPDATE product SET productName = '6603', productDescription = '', productCatId = '5', productBuyPrice = '230', productSellAllPrice = '290', productSellUnitPrice = '290', productSellHalfPrice = '290', productDate = '2024-09-14', conditions = '0', userId = '77', limitamount = '0', parcode = '06603',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240.00',lastbuyprice_withDiscount = '240',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '230' , buypricereal_precentage = '0' , buytotal_precentage = '25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='179',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15038';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:31:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:01:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:01:39', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143126');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:31:47";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:01:47", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:01:47', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a08d2404d9', '2024-11-05 14:00:18', '167', '3775.00', '17575', '0', '0', '13800',  '13800', '0', '13800', '1', '2024-11-05 14:01:48', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06861', '13611', '5', '15635', '30', '230', '6900', '0', '', '2024-11-05 14:01:48', '15635','','','0','0','0','0','0',null,'230','6900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:00:18', 1, 15635, 0, 0
                    , 230, 30, 0, 0, 77, '2024-11-05 14:01:48')
                ON DUPLICATE KEY UPDATE buyprice = 230,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:01:48' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15635', '230', '30', '0', 'buyBillController.php', '31334', '', '0', '0');
UPDATE product SET  productBuyPrice = "230" WHERE productId = 15635 ;
UPDATE buybilldetail SET  quantitybefore = -9 WHERE buybilldetailid = 31334 ;
UPDATE product SET productName = '6861', productDescription = '', productCatId = '5', productBuyPrice = '230.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '0', parcode = '06861',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '226',meanbuyprice_withDiscount = '226' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',barcodeInTax='',productNameE='',partNumber='0',vehicleType='-1',company='-1',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='226',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '15635';
UPDATE buybilldetail SET  lastbuyprice = 230 , meanbuyprice = 226, lastbuyprice_withDiscount = 230, meanbuyprice_withDiscount = 226
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 226, lastbuyprice_withDiscountAndTax = 230
                where buybilldetailid = 31334;
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 15635;
UPDATE storedetail SET  productquantity = '21', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '30', '0', '13611', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-9', '21', '77', '2024-11-05 14:00:18','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06603', '13611', '5', '15038', '30', '230', '6900', '0', '', '2024-11-05 14:01:48', '15038','','','0','0','0','0','0',null,'230','6900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:00:18', 1, 15038, 0, 0
                    , 230, 30, 0, 0, 77, '2024-11-05 14:01:48')
                ON DUPLICATE KEY UPDATE buyprice = 230,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:01:48' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15038', '230', '30', '0', 'buyBillController.php', '31335', '', '0', '0');
UPDATE product SET  productBuyPrice = "230" WHERE productId = 15038 ;
UPDATE buybilldetail SET  quantitybefore = 25 WHERE buybilldetailid = 31335 ;
UPDATE product SET productName = '6603', productDescription = '', productCatId = '5', productBuyPrice = '230.00', productSellAllPrice = '290.00', productSellUnitPrice = '290.00', productSellHalfPrice = '290.00', productDate = '2024-09-14', conditions = '0', userId = '77', limitamount = '0', parcode = '06603',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '232',meanbuyprice_withDiscount = '232' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='207',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '15038';
UPDATE buybilldetail SET  lastbuyprice = 230 , meanbuyprice = 232, lastbuyprice_withDiscount = 230, meanbuyprice_withDiscount = 232
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 207, lastbuyprice_withDiscountAndTax = 230
                where buybilldetailid = 31335;
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 15038;
UPDATE storedetail SET  productquantity = '55', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '30', '0', '13611', 'اضافة فاتورة مشتريات', 'buyBillController.php', '25', '55', '77', '2024-11-05 14:00:18','0','0');
UPDATE supplier SET  suppliercurrentDebt = '17575',suppliercurrentDebtInCurrency= '17575' , userid = '77', supplierdate = '2024-11-05 14:01:48'   WHERE supplierid = '167';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('167', '3775.00', '13800', '0', 'اضافة فاتورة مشتريات', '13611', '17575', '2024-11-05 14:00:18', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','13800','1','3775','13800','17575','0');
update buybill set dailyentryid='0,' where buybillid=13611;
COMMIT;
UPDATE product SET overAllAveragePrice = 238.18 WHERE productId = 15038;UPDATE product SET overAllAveragePrice = 233.33 WHERE productId = 15635;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:31:48";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:01:48", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:01:48', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13611');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:32:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:02:20", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:02:20', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:32:41";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:02:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:02:41', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:32:45";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:02:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:02:46', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a094cdd6be', '2024-11-05 14:02:20', '33', '68920.00', '71695', '0', '0', '2775',  '2775', '0', '2775', '1', '2024-11-05 14:02:46', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06898', '13612', '5', '15754', '15', '185', '2775', '0', '', '2024-11-05 14:02:46', '15754','','','0','0','0','0','0',null,'185','2775','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:02:20', 1, 15754, 0, 0
                    , 185, 15, 0, 0, 77, '2024-11-05 14:02:46')
                ON DUPLICATE KEY UPDATE buyprice = 185,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:02:46' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15754', '185', '15', '0', 'buyBillController.php', '31336', '', '0', '0');
UPDATE product SET  productBuyPrice = "185" WHERE productId = 15754 ;
UPDATE buybilldetail SET  quantitybefore = 12 WHERE buybilldetailid = 31336 ;
UPDATE product SET productName = '6898', productDescription = '', productCatId = '5', productBuyPrice = '185.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = '06898',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '185',lastbuyprice_withDiscount = '185',meanbuyprice = '185',meanbuyprice_withDiscount = '185' , productbuypricereal = '185.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='185',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='185',meanbuyprice_withTax='185',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='185'  WHERE productId = '15754';
UPDATE buybilldetail SET  lastbuyprice = 185 , meanbuyprice = 185, lastbuyprice_withDiscount = 185, meanbuyprice_withDiscount = 185
        , lastbuyprice_withTax = 185, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 185
                where buybilldetailid = 31336;
UPDATE productunit SET proUnitBuyPrice  = 185 * productnumber WHERE productid = 15754;
UPDATE storedetail SET  productquantity = '27', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15753';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15754', '1', '15', '0', '13612', 'اضافة فاتورة مشتريات', 'buyBillController.php', '12', '27', '77', '2024-11-05 14:02:20','0','0');
UPDATE supplier SET  suppliercurrentDebt = '71695',suppliercurrentDebtInCurrency= '71695' , userid = '77', supplierdate = '2024-11-05 14:02:46'   WHERE supplierid = '33';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('33', '68920.00', '2775', '0', 'اضافة فاتورة مشتريات', '13612', '71695', '2024-11-05 14:02:20', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','2775','1','68920','2775','71695','0');
update buybill set dailyentryid='0,' where buybillid=13612;
COMMIT;
UPDATE product SET overAllAveragePrice = 185 WHERE productId = 15754;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:32:46";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:02:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:02:46', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13612');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:32:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:02:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:02:55', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:33:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:03:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:03:23', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:33:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:03:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:03:28', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143114');
UPDATE productunit SET unitid = '1', productid = '15694', productnumber = '1.00', productunitdate = '2024-10-25', userid = '77', conditions = '0',proUnitParcode='1569401',proUnitSellAllPrice='350',proUnitSellHalfPrice='350',proUnitSellUnitPrice ='350',proUnitBuyPrice='270',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15694';
UPDATE product SET productName = 'K781', productDescription = '', productCatId = '7', productBuyPrice = '285', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '0K781',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '280.5',meanbuyprice_withDiscount = '280.5' , productbuypricereal = '285' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='279',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270'  WHERE productId = '15694';
UPDATE productunit SET unitid = '1', productid = '15694', productnumber = '1.00', productunitdate = '2024-10-25', userid = '77', conditions = '0',proUnitParcode='1569401',proUnitSellAllPrice='350',proUnitSellHalfPrice='350',proUnitSellUnitPrice ='350',proUnitBuyPrice='270',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15694';
UPDATE product SET productName = 'K781', productDescription = '', productCatId = '7', productBuyPrice = '285', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '0K781',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '280.50',meanbuyprice_withDiscount = '280.5' , productbuypricereal = '285' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='279',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270'  WHERE productId = '15694';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:34:42";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:04:42", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:04:42', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a098b8c568', '2024-11-05 14:03:23', '27', '306725.00', '323675', '0', '0', '16950',  '16950', '0', '16950', '1', '2024-11-05 14:04:42', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1368', '13613', '14', '15547', '10', '510', '5100', '0', '', '2024-11-05 14:04:42', '15547','','','0','0','0','0','0',null,'510','5100','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:03:23', 1, 15547, 0, 0
                    , 510, 10, 0, 0, 77, '2024-11-05 14:04:42')
                ON DUPLICATE KEY UPDATE buyprice = 510,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:04:42' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15547', '510', '10', '0', 'buyBillController.php', '31337', '', '0', '0');
UPDATE product SET  productBuyPrice = "510" WHERE productId = 15547 ;
UPDATE buybilldetail SET  quantitybefore = 6 WHERE buybilldetailid = 31337 ;
UPDATE product SET productName = 'H1368', productDescription = '', productCatId = '14', productBuyPrice = '510.00', productSellAllPrice = '620.00', productSellUnitPrice = '620.00', productSellHalfPrice = '620.00', productDate = '2024-10-19', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '514',meanbuyprice_withDiscount = '514' , productbuypricereal = '520.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='520',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='510',meanbuyprice_withTax='319',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='510'  WHERE productId = '15547';
UPDATE buybilldetail SET  lastbuyprice = 510 , meanbuyprice = 514, lastbuyprice_withDiscount = 510, meanbuyprice_withDiscount = 514
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 319, lastbuyprice_withDiscountAndTax = 510
                where buybilldetailid = 31337;
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 15547;
UPDATE storedetail SET  productquantity = '16', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15546';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15547', '1', '10', '0', '13613', 'اضافة فاتورة مشتريات', 'buyBillController.php', '6', '16', '77', '2024-11-05 14:03:23','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('0K781', '13613', '7', '15694', '20', '285', '5700', '0', '', '2024-11-05 14:04:42', '15694','','','0','0','0','0','0',null,'285','5700','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:03:23', 1, 15694, 0, 0
                    , 285, 20, 0, 0, 77, '2024-11-05 14:04:42')
                ON DUPLICATE KEY UPDATE buyprice = 285,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:04:42' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15694', '285', '20', '0', 'buyBillController.php', '31338', '', '0', '0');
UPDATE product SET  productBuyPrice = "285" WHERE productId = 15694 ;
UPDATE buybilldetail SET  quantitybefore = 61 WHERE buybilldetailid = 31338 ;
UPDATE product SET productName = 'K781', productDescription = '', productCatId = '7', productBuyPrice = '285.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '0K781',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '285',lastbuyprice_withDiscount = '285',meanbuyprice = '282',meanbuyprice_withDiscount = '282' , productbuypricereal = '285.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='285',meanbuyprice_withTax='280',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='285'  WHERE productId = '15694';
UPDATE buybilldetail SET  lastbuyprice = 285 , meanbuyprice = 282, lastbuyprice_withDiscount = 285, meanbuyprice_withDiscount = 282
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where buybilldetailid = 31338;
UPDATE productunit SET proUnitBuyPrice  = 285 * productnumber WHERE productid = 15694;
UPDATE storedetail SET  productquantity = '81', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '20', '0', '13613', 'اضافة فاتورة مشتريات', 'buyBillController.php', '61', '81', '77', '2024-11-05 14:03:23','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1457', '13613', '14', '15841', '15', '410', '6150', '0', '', '2024-11-05 14:04:42', '15841','','','0','0','0','0','0',null,'410','6150','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:03:23', 1, 15841, 0, 0
                    , 410, 15, 0, 0, 77, '2024-11-05 14:04:42')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:04:42' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15841', '410', '15', '0', 'buyBillController.php', '31339', '', '0', '0');
UPDATE product SET  productBuyPrice = "410" WHERE productId = 15841 ;
UPDATE buybilldetail SET  quantitybefore = 13 WHERE buybilldetailid = 31339 ;
UPDATE product SET productName = 'H1457', productDescription = '', productCatId = '14', productBuyPrice = '410.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1457',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410'  WHERE productId = '15841';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 31339;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 15841;
UPDATE storedetail SET  productquantity = '28', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '15', '0', '13613', 'اضافة فاتورة مشتريات', 'buyBillController.php', '13', '28', '77', '2024-11-05 14:03:23','0','0');
UPDATE supplier SET  suppliercurrentDebt = '323675',suppliercurrentDebtInCurrency= '323675' , userid = '77', supplierdate = '2024-11-05 14:04:42'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '306725.00', '16950', '0', 'اضافة فاتورة مشتريات', '13613', '323675', '2024-11-05 14:03:23', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','16950','1','306725','16950','323675','0');
update buybill set dailyentryid='0,' where buybillid=13613;
COMMIT;
UPDATE product SET overAllAveragePrice = 515 WHERE productId = 15547;UPDATE product SET overAllAveragePrice = 280.91 WHERE productId = 15694;UPDATE product SET overAllAveragePrice = 410 WHERE productId = 15841;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:34:43";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:04:43", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:04:43', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13613');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('يوسف اشرف 12' , '', '', '01062720840', '0', '', '0', '2024-11-05 14:04:45', '9', '0','','0','','-10','0','0',',','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10280', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10280','0','0','0','إضافة عميل جديد','10280', '0', '2024-11-05 14:04:45', '9', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('يوسف اشرف 12', 'يوسف اشرف 12', 'يوسف اشرف 12', 'يوسف اشرف 12', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '9', '0', '2024-11-05 14:04:45');
UPDATE client SET clientname = 'يوسف اشرف 12', clientaddress = '', clientphone = '', clientmobile = '01062720840', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '9'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='0' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11187',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10280';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:34:52";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:04:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:04:52', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143114 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143114 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143114;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 14:04:52', userid = '2',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143114';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34535;
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523122;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-61
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-61
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '14', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '13', '14', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 27831;
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 523123;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12130, '2024-11-05', 270, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-270, sellCostBuyPrice =sellCostBuyPrice-380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-380, sellCostMeanBuyPrice = sellCostMeanBuyPrice-380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-270, sellCostBuyPrice =sellCostBuyPrice-380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-380, sellCostMeanBuyPrice = sellCostMeanBuyPrice-380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '12129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12130', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34523;
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523124;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15614, '2024-11-05', 300, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-300, sellCostBuyPrice =sellCostBuyPrice-260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-300, sellCostBuyPrice =sellCostBuyPrice-260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15613';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15614', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 6242;
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        
                where sellbilldetailid = 523125;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3565, '2024-11-05', 240, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-530, sellCostMeanBuyPrice = sellCostMeanBuyPrice-530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-530, sellCostMeanBuyPrice = sellCostMeanBuyPrice-530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '3564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3565', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34201;
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 591, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 523126;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15475, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-650, sellCostBuyPrice =sellCostBuyPrice-575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-575, sellCostMeanBuyPrice = sellCostMeanBuyPrice-575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-591
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-650, sellCostBuyPrice =sellCostBuyPrice-575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-575, sellCostMeanBuyPrice = sellCostMeanBuyPrice-575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-591
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '19', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15475', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '19', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34536;
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523127;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-05', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-122
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-122
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '19', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '19', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31298;
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        
                where sellbilldetailid = 523128;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14072, '2024-11-05', 240, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-385, sellCostMeanBuyPrice = sellCostMeanBuyPrice-385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-385, sellCostMeanBuyPrice = sellCostMeanBuyPrice-385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '14071';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14072', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-11-04 15:58:54','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        
                where sellbilldetailid = 523129;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15088, '2024-11-05', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15087';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15088', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-1', '0', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 22032;
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523130;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10061, '2024-11-05', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '11', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '10060';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10061', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '11', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34396;
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        
                where sellbilldetailid = 523131;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15294, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15293';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15294', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-04 15:58:54','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523132;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15366, '2024-11-05', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15365';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15366', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-1', '0', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 32910;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523133;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14779, '2024-11-05', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-320, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-320, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '14778';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14779', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34862;
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523134;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15835, '2024-11-05', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-300, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-235
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-300, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-235
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15835', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '9', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34625;
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523135;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-270, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-220
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-270, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-220
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '46', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '45', '46', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34793;
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 282.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 282.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523136;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-285, sellCostMeanBuyPrice = sellCostMeanBuyPrice-282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-280
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-285, sellCostMeanBuyPrice = sellCostMeanBuyPrice-282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-280
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '82', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '81', '82', '2', '2024-11-04 15:58:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34473;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523137;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15609, '2024-11-05', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-270
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-270
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15608';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15609', '1', '1', '0', '143114', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7', '8', '2', '2024-11-04 15:58:54','0','0');
CALL clientInUse(3095,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '3095';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3095','5055.00','5055.00','1','تعديل فاتورة مبيعات','143114', '0', '2024-11-04 15:58:54', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '5055', '0', null, '0', null, null,'', '0','1','1','5055','1','2024-11-04 15:58:54','0','0');
UPDATE client SET  inUse = 0 where clientid = 3095;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 5055, 4925, 4925
                    , 4921, 4925, 4921, 4917.58
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2145, 2039, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5055, sellCostBuyPrice =sellCostBuyPrice-4925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4925, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4921
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4925, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4921
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4917.58
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2039
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3095, '2024-11-05', 5055, 4925, 4925
                    , 4921, 4925, 4921, 4917.58
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2145, 2039, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5055, sellCostBuyPrice =sellCostBuyPrice-4925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4925, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4921
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4925, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4921
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4917.58
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2039
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5055, 4925, 4925
                    , 4921, 4925, 4921, 4917.58, 2145, 2039)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-5055, netSellCostBuyPrice = netSellCostBuyPrice-4925
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-4925
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-4921
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-4925
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-4921
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-4917.58
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-2145
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-2039;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143114 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143114 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(3095,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 15:58:54', '06728d31ecee92', '3095', '0.00', '3891', '195', '1', '4086', '3891', '0', '3891', '1', '2024-11-04 15:58:54', '', '2', '0', 'اسراء رزق K36', '2', '1', '3', '79', 'اسراء رزق K36', '15', '143114', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '3891', userid = '2' WHERE clientid = '3095';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3095','0.00','3891','0','اضافة فاتورة مبيعات (معدله)','143225', '3891', '2024-11-05 14:04:52', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '3891', '0', null, '0', null, null,'', '0','1','1','5055','1','2024-11-04 15:58:54','0','0');
UPDATE client SET  inUse = 0 where clientid = 3095;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34535;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06813', '143225', '5', '15496', '1', '200', '200', '0', '', '1', '2024-11-05 14:04:52', '15496', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34535-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523520;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-05', 190.45521292217, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190.45521292217, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190.45521292217, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190.45521292217, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '14', '13', '2', '2024-11-05 14:04:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27831;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','05586', '143225', '5', '12130', '1', '270', '270', '0', '', '1', '2024-11-05 14:04:52', '12130', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27831-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 523521;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12130, '2024-11-05', 257.11453744493, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+257.11453744493, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 257.11453744493, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+257.11453744493, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '12129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12130', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '2', '2024-11-05 14:04:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34523;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3259', '143225', '1', '15614', '1', '300', '300', '0', '', '1', '2024-11-05 14:04:52', '15614', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34523-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523522;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15614, '2024-11-05', 285.68281938326, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285.68281938326, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285.68281938326, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285.68281938326, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15613';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15614', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '2', '2024-11-05 14:04:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34201;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1356', '143225', '14', '15475', '1', '650', '650', '0', '', '1', '2024-11-05 14:04:52', '15475', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34201-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 591, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 523523;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15475, '2024-11-05', 618.97944199706, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+618.97944199706, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 618.97944199706, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+618.97944199706, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15475', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '19', '18', '2', '2024-11-05 14:04:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34536;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06786', '143225', '5', '15389', '1', '200', '200', '0', '', '1', '2024-11-05 14:04:52', '15389', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34536-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523524;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-05', 190.45521292217, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190.45521292217, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190.45521292217, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190.45521292217, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '2', storedetaildate = '2024-11-05 14:04:52' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '19', '18', '2', '2024-11-05 14:04:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31298;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('385','0A280', '143225', '6', '14072', '1', '240', '240', '0', '', '1', '2024-11-05 14:04:53', '14072', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31298-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        
                where sellbilldetailid = 523525;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14072, '2024-11-05', 228.54625550661, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+228.54625550661, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 228.54625550661, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+228.54625550661, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 14:04:53' WHERE storedetailid = '14071';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14072', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '2', '2024-11-05 14:04:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','06620', '143225', '5', '15088', '1', '500', '500', '0', '', '1', '2024-11-05 14:04:53', '15088', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        
                where sellbilldetailid = 523526;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15088, '2024-11-05', 476.13803230543, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+476.13803230543, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 476.13803230543, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+476.13803230543, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '2', storedetaildate = '2024-11-05 14:04:53' WHERE storedetailid = '15087';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15088', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '0', '-1', '2', '2024-11-05 14:04:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 22032;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','04623', '143225', '5', '10061', '1', '195', '195', '0', '', '1', '2024-11-05 14:04:53', '10061', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','22032-1,','1','1','0','0','195','195','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523527;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10061, '2024-11-05', 185.69383259912, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185.69383259912, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185.69383259912, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185.69383259912, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2024-11-05 14:04:53' WHERE storedetailid = '10060';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10061', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '11', '10', '2', '2024-11-05 14:04:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34396;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06739', '143225', '5', '15294', '1', '220', '220', '0', '', '1', '2024-11-05 14:04:53', '15294', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34396-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        
                where sellbilldetailid = 523528;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15294, '2024-11-05', 209.50073421439, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+209.50073421439, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 209.50073421439, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+209.50073421439, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 14:04:53' WHERE storedetailid = '15293';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15294', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '5', '2', '2024-11-05 14:04:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34862;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','H1453', '143225', '14', '15835', '1', '300', '300', '0', '', '1', '2024-11-05 14:04:53', '15835', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34862-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523529;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15835, '2024-11-05', 285.68281938326, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285.68281938326, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285.68281938326, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285.68281938326, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 14:04:53' WHERE storedetailid = '15834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15835', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '8', '2', '2024-11-05 14:04:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143225', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-05 14:04:53', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523530;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-05', 257.11453744493, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+257.11453744493, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 257.11453744493, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+257.11453744493, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '45', userid = '2', storedetaildate = '2024-11-05 14:04:53' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '46', '45', '2', '2024-11-05 14:04:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143225', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-05 14:04:53', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 282.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 282.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523531;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 333.2966226138, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+333.2966226138, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 333.2966226138, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+333.2966226138, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '81', userid = '2', storedetaildate = '2024-11-05 14:04:53' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '82', '81', '2', '2024-11-05 14:04:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34473;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R3257', '143225', '1', '15609', '1', '330', '330', '0', '', '1', '2024-11-05 14:04:53', '15609', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34473-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 523532;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15609, '2024-11-05', 314.25110132159, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+314.25110132159, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 314.25110132159, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+314.25110132159, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-05 14:04:53' WHERE storedetailid = '15608';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15609', '1', '1', '1', '143225', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '7', '2', '2024-11-05 14:04:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143225', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:04:53', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143225', '17', '10291', '1', '41', '41', '0', '', '1', '2024-11-05 14:04:53', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','41','41','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 3891, 3775, 3775
                    , 3771, 3775, 3771, 3767.58
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2145, 2039, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3891, sellCostBuyPrice =sellCostBuyPrice+3775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3771
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3771
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3767.58
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2039
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3095, '2024-11-05', 3891, 3775, 3775
                    , 3771, 3775, 3771, 3767.58
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2145, 2039, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3891, sellCostBuyPrice =sellCostBuyPrice+3775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3771
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3771
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3767.58
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2039
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3891, 3775, 3775
                    , 3771, 3775, 3771, 3767.58, 2145, 2039)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3891, netSellCostBuyPrice = netSellCostBuyPrice+3775
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3775
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3771
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3775
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3771
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3767.58
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2145
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2039;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143114 and newid=143225 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:34:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:04:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:04:54', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:34:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:04:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:04:54', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143225');
UPDATE productunit SET unitid = '1', productid = '15821', productnumber = '1.00', productunitdate = '2024-11-01', userid = '77', conditions = '0',proUnitParcode='1582101',proUnitSellAllPrice='200',proUnitSellHalfPrice='200',proUnitSellUnitPrice ='200',proUnitBuyPrice='145',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15821';
UPDATE product SET productName = '6940', productDescription = '', productCatId = '5', productBuyPrice = '140', productSellAllPrice = '200', productSellUnitPrice = '200', productSellHalfPrice = '200', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06940',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '145.00',lastbuyprice_withDiscount = '145',meanbuyprice = '142.5',meanbuyprice_withDiscount = '142.5' , productbuypricereal = '145' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='145',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='145',meanbuyprice_withTax='145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='145'  WHERE productId = '15821';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:35:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:05:20", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:05:20', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a09e638a1c', '2024-11-05 14:04:54', '19', '216700.00', '218800', '0', '0', '2100',  '2100', '0', '2100', '1', '2024-11-05 14:05:20', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06940', '13614', '5', '15821', '15', '140', '2100', '0', '', '2024-11-05 14:05:20', '15821','','','0','0','0','0','0',null,'140','2100','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:04:54', 1, 15821, 0, 0
                    , 140, 15, 0, 0, 77, '2024-11-05 14:05:20')
                ON DUPLICATE KEY UPDATE buyprice = 140,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:05:20' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15821', '140', '15', '0', 'buyBillController.php', '31340', '', '0', '0');
UPDATE product SET  productBuyPrice = "140" WHERE productId = 15821 ;
UPDATE buybilldetail SET  quantitybefore = 15 WHERE buybilldetailid = 31340 ;
UPDATE product SET productName = '6940', productDescription = '', productCatId = '5', productBuyPrice = '140.00', productSellAllPrice = '200.00', productSellUnitPrice = '200.00', productSellHalfPrice = '200.00', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06940',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '141',meanbuyprice_withDiscount = '141' , productbuypricereal = '145.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='145',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='140',meanbuyprice_withTax='143',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='140'  WHERE productId = '15821';
UPDATE buybilldetail SET  lastbuyprice = 140 , meanbuyprice = 141, lastbuyprice_withDiscount = 140, meanbuyprice_withDiscount = 141
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 143, lastbuyprice_withDiscountAndTax = 140
                where buybilldetailid = 31340;
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 15821;
UPDATE storedetail SET  productquantity = '30', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15820';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15821', '1', '15', '0', '13614', 'اضافة فاتورة مشتريات', 'buyBillController.php', '15', '30', '77', '2024-11-05 14:04:54','0','0');
UPDATE supplier SET  suppliercurrentDebt = '218800',suppliercurrentDebtInCurrency= '218800' , userid = '77', supplierdate = '2024-11-05 14:05:20'   WHERE supplierid = '19';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('19', '216700.00', '2100', '0', 'اضافة فاتورة مشتريات', '13614', '218800', '2024-11-05 14:04:54', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','2100','1','216700','2100','218800','0');
update buybill set dailyentryid='0,' where buybillid=13614;
COMMIT;
UPDATE product SET overAllAveragePrice = 142.5 WHERE productId = 15821;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:35:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:05:20", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:05:20', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13614');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:35:27";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:05:27", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:05:27', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:35:41";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:05:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:05:41', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:35:53";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:05:53", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:05:53', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a0a0766be9', '2024-11-05 14:05:27', '137', '28780.00', '31280', '0', '0', '2500',  '2500', '0', '2500', '1', '2024-11-05 14:05:53', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1358', '13615', '14', '15474', '5', '500', '2500', '0', '', '2024-11-05 14:05:53', '15474','','','0','0','0','0','0',null,'500','2500','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:05:27', 1, 15474, 0, 0
                    , 500, 5, 0, 0, 77, '2024-11-05 14:05:53')
                ON DUPLICATE KEY UPDATE buyprice = 500,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:05:53' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15474', '500', '5', '0', 'buyBillController.php', '31341', '', '0', '0');
UPDATE product SET  productBuyPrice = "500" WHERE productId = 15474 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 31341 ;
UPDATE product SET productName = 'H1358', productDescription = '', productCatId = '14', productBuyPrice = '500.00', productSellAllPrice = '620.00', productSellUnitPrice = '620.00', productSellHalfPrice = '620.00', productDate = '2024-10-15', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1358',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='500',meanbuyprice_withTax='326',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='500'  WHERE productId = '15474';
UPDATE buybilldetail SET  lastbuyprice = 500 , meanbuyprice = 500, lastbuyprice_withDiscount = 500, meanbuyprice_withDiscount = 500
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 326, lastbuyprice_withDiscountAndTax = 500
                where buybilldetailid = 31341;
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 15474;
UPDATE storedetail SET  productquantity = '29', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15474', '1', '5', '0', '13615', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '29', '77', '2024-11-05 14:05:27','0','0');
UPDATE supplier SET  suppliercurrentDebt = '31280',suppliercurrentDebtInCurrency= '31280' , userid = '77', supplierdate = '2024-11-05 14:05:53'   WHERE supplierid = '137';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('137', '28780.00', '2500', '0', 'اضافة فاتورة مشتريات', '13615', '31280', '2024-11-05 14:05:27', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','2500','1','28780','2500','31280','0');
update buybill set dailyentryid='0,' where buybillid=13615;
COMMIT;
UPDATE product SET overAllAveragePrice = 500 WHERE productId = 15474;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:35:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:05:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:05:54', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13615');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:36:02";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:06:02", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:06:02', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:36:37";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:06:37", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:06:37', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a040d12358
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9690,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:39:57', '0672a040d12358', '9690', '0.00', '1586', '0', '1', '1586.00', '1586', '0', '1586', '1', '2024-11-05 14:06:37', '', '75', '0', 'اسماء فوزي12', '2', '1', '3', '81', 'اسماء فوزي12', '6' ,'0','','','','','-1','0','0','0','0','0','1586','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1586', userid = '75' WHERE clientid = '9690';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9690','0.00','1586','0','اضافة فاتورة مبيعات','143226', '1586', '2024-11-05 14:06:37', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1586', '0', null, '0', null, null,'', '0','1','1','1586','1','2024-11-05 13:39:57','0','0');
UPDATE client SET  inUse = 0 where clientid = 9690;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34667;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06908', '143226', '5', '15735', '1', '210', '210', '0', '', '1', '2024-11-05 14:06:37', '15735', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34667-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523535;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15735, '2024-11-05', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 14:06:37' WHERE storedetailid = '15734';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15735', '1', '1', '1', '143226', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-05 14:06:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34453;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('620','H1389', '143226', '14', '15593', '1', '740', '740', '0', '', '1', '2024-11-05 14:06:37', '15593', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34453-1,','1','1','0','0','740','740','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 620.00 , meanbuyprice = 620.00, lastbuyprice_withDiscount = 620.00, meanbuyprice_withDiscount = 620.00
        , lastbuyprice_withTax = 620, meanbuyprice_withTax = 620, lastbuyprice_withDiscountAndTax = 620
                where sellbilldetailid = 523536;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15593, '2024-11-05', 740, 620, 620
                    , 620, 620, 620, 620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 620, 620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 740, 620, 620
                    , 620, 620, 620, 620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 620, 620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 14:06:37' WHERE storedetailid = '15592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15593', '1', '1', '1', '143226', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 14:06:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34642;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06900', '143226', '5', '15715', '2', '300', '600', '0', '', '1', '2024-11-05 14:06:37', '15715', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34642-2,','1','1','0','0','300','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 239.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 239.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 238, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523537;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15715, '2024-11-05', 600, 480, 480
                    , 478, 480, 478, 476.66
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 480, 476, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+478
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+478
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+476.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+476
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 600, 480, 480
                    , 478, 480, 478, 476.66
                    , 0, 0, 0, 0
                    , 0, 0, 0, 480, 476, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+478
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+478
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+476.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+476
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '38', userid = '75', storedetaildate = '2024-11-05 14:06:37' WHERE storedetailid = '15714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15715', '1', '2', '1', '143226', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '38', '75', '2024-11-05 14:06:37','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143226', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:06:37', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143226', '17', '10291', '1', '16', '16', '0', '', '1', '2024-11-05 14:06:37', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16','16','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 9690;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1586, 1265, 1265
                    , 1263, 1265, 1263, 1261.66
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1265, 1261, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1586, sellCostBuyPrice =sellCostBuyPrice+1265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1263
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1263
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1261.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1261
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9690, '2024-11-05', 1586, 1265, 1265
                    , 1263, 1265, 1263, 1261.66
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1265, 1261, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1586, sellCostBuyPrice =sellCostBuyPrice+1265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1263
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1263
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1261.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1261
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1586, 1265, 1265
                    , 1263, 1265, 1263, 1261.66, 1265, 1261)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1586, netSellCostBuyPrice = netSellCostBuyPrice+1265
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1265
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1263
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1265
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1263
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1261.66
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1265
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1261;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a040d12358 and sellbillId = 143226 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:36:38";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:06:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:06:38', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:37:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:07:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:07:04', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a08b2b3029
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10280,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:59:46', '0672a08b2b3029', '10280', '0.00', '434', '0', '1', '434.00', '434', '0', '434', '1', '2024-11-05 14:07:04', '', '9', '0', 'يوسف اشرف 12', '1', '1', '3', '95', 'يوسف اشرف 12', '2' ,'0','','','','','-1','0','0','0','0','0','434','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '434', userid = '9' WHERE clientid = '10280';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10280','0.00','434','0','اضافة فاتورة مبيعات','143227', '434', '2024-11-05 14:07:04', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '434', '0', null, '0', null, null,'', '0','1','1','434','1','2024-11-05 13:59:46','0','0');
UPDATE client SET  inUse = 0 where clientid = 10280;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34868;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','H1454', '143227', '14', '15837', '1', '430', '430', '0', '', '1', '2024-11-05 14:07:04', '15837', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34868-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 523540;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15837, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 14:07:04' WHERE storedetailid = '15836';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15837', '1', '1', '1', '143227', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-05 14:07:04','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143227', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-05 14:07:04', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 95 where clientid = 10280;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 434, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+434, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10280, '2024-11-05', 434, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+434, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 434, 350, 350
                    , 350, 350, 350, 350, 350, 350)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+434, netSellCostBuyPrice = netSellCostBuyPrice+350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a08b2b3029 and sellbillId = 143227 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:37:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:07:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:07:05', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6953','','5','270','330', '330','330', '2024-11-05', '0', '77', '1', '06953', '0', '0', '0', '0', '0', '270','270','270','270','270','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','270','270','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15860, 1,'2024-11-05 14:08:01',77)
                ON DUPLICATE KEY UPDATE productid = 15860, edited = 1, sysdate = '2024-11-05 14:08:01', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15860', '1', '2024-11-05', '77', '0','1586001','330','330','330','270','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15860', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15860', '1', '0', '0', '15860', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6954','','5','250','310', '310','310', '2024-11-05', '0', '77', '1', '06954', '0', '0', '0', '0', '0', '250','250','250','250','250','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','250','250','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15861, 1,'2024-11-05 14:08:19',77)
                ON DUPLICATE KEY UPDATE productid = 15861, edited = 1, sysdate = '2024-11-05 14:08:19', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15861', '1', '2024-11-05', '77', '0','1586101','310','310','310','250','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15861', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15861', '1', '0', '0', '15861', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6956','','5','250','310', '310','310', '2024-11-05', '0', '77', '1', '06956', '0', '0', '0', '0', '0', '250','250','250','250','250','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','250','250','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15862, 1,'2024-11-05 14:08:35',77)
                ON DUPLICATE KEY UPDATE productid = 15862, edited = 1, sysdate = '2024-11-05 14:08:35', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15862', '1', '2024-11-05', '77', '0','1586201','310','310','310','250','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15862', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15862', '1', '0', '0', '15862', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:40:46";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:10:46", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:10:46', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0a4e99982
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8055,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:06:38', '0672a0a4e99982', '8055', '899.00', '1273', '0', '1', '374.00', '374', '0', '374', '1', '2024-11-05 14:10:47', '', '75', '0', 'مدام سحر محمود W231', '2', '1', '3', '91', 'مدام سحر محمود W231', '3' ,'0','','','','','-1','0','0','0','0','0','374','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1273', userid = '75' WHERE clientid = '8055';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8055','899.00','374','0','اضافة فاتورة مبيعات','143228', '1273', '2024-11-05 14:10:47', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '374', '0', null, '0', null, null,'', '0','1','1','374','1','2024-11-05 14:06:38','0','0');
UPDATE client SET  inUse = 0 where clientid = 8055;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34449;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3251', '143228', '1', '15589', '1', '350', '350', '0', '', '1', '2024-11-05 14:10:47', '15589', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34449-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523542;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15589, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '75', storedetaildate = '2024-11-05 14:10:47' WHERE storedetailid = '15588';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15589', '1', '1', '1', '143228', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '75', '2024-11-05 14:10:47','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143228', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:10:47', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143228', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-05 14:10:47', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 8055;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 374, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+374, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8055, '2024-11-05', 374, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+374, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 374, 285, 285
                    , 285, 285, 285, 285, 285, 285)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+374, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+285;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0a4e99982 and sellbillId = 143228 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:40:47";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:10:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:10:47', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:42:18";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:12:18", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:12:18', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0b480b552
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9690,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:10:48', '0672a0b480b552', '9690', '1586.00', '1788', '0', '1', '202.00', '202', '0', '202', '1', '2024-11-05 14:12:18', '', '75', '0', 'اسماء فوزي12', '2', '1', '3', '81', 'اسماء فوزي12', '2' ,'0','','','','','-1','0','0','0','0','0','202','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1788', userid = '75' WHERE clientid = '9690';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9690','1586.00','202','0','اضافة فاتورة مبيعات','143229', '1788', '2024-11-05 14:12:18', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '202', '0', null, '0', null, null,'', '0','1','1','202','1','2024-11-05 14:10:48','0','0');
UPDATE client SET  inUse = 0 where clientid = 9690;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34823;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06940', '143229', '5', '15821', '1', '200', '200', '0', '', '1', '2024-11-05 14:12:18', '15821', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34823-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 143, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523545;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15821, '2024-11-05', 200, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-05 14:12:18' WHERE storedetailid = '15820';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15821', '1', '1', '1', '143229', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '75', '2024-11-05 14:12:18','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143229', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-05 14:12:18', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 9690;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 202, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+202, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9690, '2024-11-05', 202, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+202, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 202, 140, 140
                    , 141, 140, 141, 142.5, 140, 143)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+202, netSellCostBuyPrice = netSellCostBuyPrice+140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+141
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+141
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+142.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+143;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0b480b552 and sellbillId = 143229 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:42:19";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:12:19", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:12:19', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:42:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:12:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:12:29', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0a6999770
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:07:05', '0672a0a6999770', '1', '0.00', '0', '0', '1', '400.00', '400', '400', '0', '1', '2024-11-05 14:12:29', '', '9', '0', 'نقدي', '1', '0', '3', '73', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','400','0','','0','0','400','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143230', '0', '2024-11-05 14:12:29', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '400', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:07:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33588;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','0K778', '143230', '7', '15157', '1', '400', '400', '0', '', '1', '2024-11-05 14:12:29', '15157', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33588-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 402.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 402.00
        
                where sellbilldetailid = 523547;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15157, '2024-11-05', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 14:12:29' WHERE storedetailid = '15156';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15157', '1', '1', '1', '143230', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 14:12:29','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '22815',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('22415','400', '0', '1', 'اضافة فاتورة مبيعات', '143230', '22815', '2024-11-05 14:12:29', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 73 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 335, 335
                    , 402, 335, 402, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 400, 335, 335
                    , 402, 335, 402, 335, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+400, netSellCostBuyPrice = netSellCostBuyPrice+335
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+335
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+402
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+335
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+402
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+335
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0a6999770 and sellbillId = 143230 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:42:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:12:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:12:30', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:43:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:13:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:13:57', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0bae8717c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:12:30', '0672a0bae8717c', '1', '0.00', '0', '0', '1', '760.00', '760', '760', '0', '1', '2024-11-05 14:13:57', '', '9', '0', 'نقدي', '1', '0', '3', '93', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','760','0','','0','0','760','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143231', '0', '2024-11-05 14:13:57', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '760', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:12:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34716;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06879', '143231', '5', '15669', '1', '210', '210', '0', '', '1', '2024-11-05 14:13:57', '15669', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34716-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 523548;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15669, '2024-11-05', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 14:13:57' WHERE storedetailid = '15668';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15669', '1', '1', '1', '143231', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 14:13:57','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('365','H1370', '143231', '14', '15565', '1', '550', '550', '0', '', '1', '2024-11-05 14:13:57', '15565', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 365.00
        
                where sellbilldetailid = 523549;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15565, '2024-11-05', 550, 365, 365
                    , 365, 365, 365, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 365, 365
                    , 365, 365, 365, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 14:13:57' WHERE storedetailid = '15564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15565', '1', '1', '1', '143231', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 14:13:57','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '23575',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('22815','760', '0', '1', 'اضافة فاتورة مبيعات', '143231', '23575', '2024-11-05 14:13:57', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 93 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 760, 525, 525
                    , 525, 525, 525, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+760, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 760, 525, 525
                    , 525, 525, 525, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+760, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 760, 525, 525
                    , 525, 525, 525, 160, 160, 160)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+760, netSellCostBuyPrice = netSellCostBuyPrice+525
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+525
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+525
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+525
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+525
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+160
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+160
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+160;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0bae8717c and sellbillId = 143231 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:43:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:13:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:13:58', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:44:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:14:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:14:39', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0ba3b0a72
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8055,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:12:19', '0672a0ba3b0a72', '8055', '1273.00', '1495', '0', '1', '222.00', '222', '0', '222', '1', '2024-11-05 14:14:39', '', '75', '0', 'مدام سحر محمود W231', '2', '1', '3', '83', 'مدام سحر محمود W231', '3' ,'0','','','','','-1','0','0','0','0','0','222','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1495', userid = '75' WHERE clientid = '8055';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8055','1273.00','222','0','اضافة فاتورة مبيعات','143232', '1495', '2024-11-05 14:14:39', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '222', '0', null, '0', null, null,'', '0','1','1','222','1','2024-11-05 14:12:19','0','0');
UPDATE client SET  inUse = 0 where clientid = 8055;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34823;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06940', '143232', '5', '15821', '1', '200', '200', '0', '', '1', '2024-11-05 14:14:40', '15821', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34823-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 143, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523550;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15821, '2024-11-05', 200, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-05 14:14:40' WHERE storedetailid = '15820';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15821', '1', '1', '1', '143232', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-05 14:14:40','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143232', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:14:40', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143232', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-05 14:14:40', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 8055;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 222, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8055, '2024-11-05', 222, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 222, 140, 140
                    , 141, 140, 141, 142.5, 140, 143)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+222, netSellCostBuyPrice = netSellCostBuyPrice+140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+141
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+141
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+142.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+143;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0ba3b0a72 and sellbillId = 143232 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:44:40";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:14:40", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:14:40', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:45:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:15:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:15:45', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:45:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:15:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:15:54', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a0a2a8ef3b', '2024-11-05 14:06:02', '78', '345040.00', '370390', '0', '0', '25350',  '25350', '0', '25350', '1', '2024-11-05 14:15:54', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06931', '13616', '5', '15806', '15', '155', '2325', '0', '', '2024-11-05 14:15:54', '15806','','','0','0','0','0','0',null,'155','2325','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15806, 0, 0
                    , 155, 15, 0, 0, 77, '2024-11-05 14:15:54')
                ON DUPLICATE KEY UPDATE buyprice = 155,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:15:54' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15806', '155', '15', '0', 'buyBillController.php', '31342', '', '0', '0');
UPDATE product SET  productBuyPrice = "155" WHERE productId = 15806 ;
UPDATE buybilldetail SET  quantitybefore = 15 WHERE buybilldetailid = 31342 ;
UPDATE product SET productName = '6931', productDescription = '', productCatId = '5', productBuyPrice = '155.00', productSellAllPrice = '210.00', productSellUnitPrice = '210.00', productSellHalfPrice = '210.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06931',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '155',lastbuyprice_withDiscount = '155',meanbuyprice = '155',meanbuyprice_withDiscount = '155' , productbuypricereal = '155.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='155',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='155',meanbuyprice_withTax='155',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='155'  WHERE productId = '15806';
UPDATE buybilldetail SET  lastbuyprice = 155 , meanbuyprice = 155, lastbuyprice_withDiscount = 155, meanbuyprice_withDiscount = 155
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where buybilldetailid = 31342;
UPDATE productunit SET proUnitBuyPrice  = 155 * productnumber WHERE productid = 15806;
UPDATE storedetail SET  productquantity = '30', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15805';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15806', '1', '15', '0', '13616', 'اضافة فاتورة مشتريات', 'buyBillController.php', '15', '30', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06891', '13616', '5', '15664', '15', '145', '2175', '0', '', '2024-11-05 14:15:54', '15664','','','0','0','0','0','0',null,'145','2175','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15664, 0, 0
                    , 145, 15, 0, 0, 77, '2024-11-05 14:15:54')
                ON DUPLICATE KEY UPDATE buyprice = 145,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:15:54' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15664', '145', '15', '0', 'buyBillController.php', '31343', '', '0', '0');
UPDATE product SET  productBuyPrice = "145" WHERE productId = 15664 ;
UPDATE buybilldetail SET  quantitybefore = 27 WHERE buybilldetailid = 31343 ;
UPDATE product SET productName = '6891', productDescription = '', productCatId = '5', productBuyPrice = '145.00', productSellAllPrice = '210.00', productSellUnitPrice = '210.00', productSellHalfPrice = '210.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '06891',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '145',lastbuyprice_withDiscount = '145',meanbuyprice = '145',meanbuyprice_withDiscount = '145' , productbuypricereal = '145.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='145',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='145',meanbuyprice_withTax='145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='145'  WHERE productId = '15664';
UPDATE buybilldetail SET  lastbuyprice = 145 , meanbuyprice = 145, lastbuyprice_withDiscount = 145, meanbuyprice_withDiscount = 145
        , lastbuyprice_withTax = 145, meanbuyprice_withTax = 145, lastbuyprice_withDiscountAndTax = 145
                where buybilldetailid = 31343;
UPDATE productunit SET proUnitBuyPrice  = 145 * productnumber WHERE productid = 15664;
UPDATE storedetail SET  productquantity = '42', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15664', '1', '15', '0', '13616', 'اضافة فاتورة مشتريات', 'buyBillController.php', '27', '42', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06953', '13616', '5', '15860', '15', '270', '4050', '0', '', '2024-11-05 14:15:54', '15860','','','0','0','0','0','0',null,'270','4050','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15860, 0, 0
                    , 270, 15, 0, 0, 77, '2024-11-05 14:15:54')
                ON DUPLICATE KEY UPDATE buyprice = 270,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:15:54' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15860', '270', '15', '0', 'buyBillController.php', '31344', '', '0', '0');
UPDATE product SET  productBuyPrice = "270" WHERE productId = 15860 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31344 ;
UPDATE product SET productName = '6953', productDescription = '', productCatId = '5', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270',lastbuyprice_withDiscount = '270',meanbuyprice = '270',meanbuyprice_withDiscount = '270' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='270',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270'  WHERE productId = '15860';
UPDATE buybilldetail SET  lastbuyprice = 270 , meanbuyprice = 270, lastbuyprice_withDiscount = 270, meanbuyprice_withDiscount = 270
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where buybilldetailid = 31344;
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 15860;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15859';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15860', '1', '15', '0', '13616', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06954', '13616', '5', '15861', '15', '250', '3750', '0', '', '2024-11-05 14:15:54', '15861','','','0','0','0','0','0',null,'250','3750','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15861, 0, 0
                    , 250, 15, 0, 0, 77, '2024-11-05 14:15:55')
                ON DUPLICATE KEY UPDATE buyprice = 250,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:15:55' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15861', '250', '15', '0', 'buyBillController.php', '31345', '', '0', '0');
UPDATE product SET  productBuyPrice = "250" WHERE productId = 15861 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31345 ;
UPDATE product SET productName = '6954', productDescription = '', productCatId = '5', productBuyPrice = '250.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='250',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='250'  WHERE productId = '15861';
UPDATE buybilldetail SET  lastbuyprice = 250 , meanbuyprice = 250, lastbuyprice_withDiscount = 250, meanbuyprice_withDiscount = 250
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where buybilldetailid = 31345;
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 15861;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15860';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15861', '1', '15', '0', '13616', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06956', '13616', '5', '15862', '15', '250', '3750', '0', '', '2024-11-05 14:15:54', '15862','','','0','0','0','0','0',null,'250','3750','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15862, 0, 0
                    , 250, 15, 0, 0, 77, '2024-11-05 14:15:55')
                ON DUPLICATE KEY UPDATE buyprice = 250,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:15:55' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15862', '250', '15', '0', 'buyBillController.php', '31346', '', '0', '0');
UPDATE product SET  productBuyPrice = "250" WHERE productId = 15862 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31346 ;
UPDATE product SET productName = '6956', productDescription = '', productCatId = '5', productBuyPrice = '250.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06956',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='250',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='250'  WHERE productId = '15862';
UPDATE buybilldetail SET  lastbuyprice = 250 , meanbuyprice = 250, lastbuyprice_withDiscount = 250, meanbuyprice_withDiscount = 250
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where buybilldetailid = 31346;
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 15862;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15861';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15862', '1', '15', '0', '13616', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3248', '13616', '1', '15660', '5', '240', '1200', '0', '', '2024-11-05 14:15:54', '15660','','','0','0','0','0','0',null,'240','1200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15660, 0, 0
                    , 240, 5, 0, 0, 77, '2024-11-05 14:15:55')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:15:55' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15660', '240', '5', '0', 'buyBillController.php', '31347', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15660 ;
UPDATE buybilldetail SET  quantitybefore = 6 WHERE buybilldetailid = 31347 ;
UPDATE product SET productName = 'R3248', productDescription = '', productCatId = '1', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3248',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15660';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 240, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 240
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31347;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15660;
UPDATE storedetail SET  productquantity = '11', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15660', '1', '5', '0', '13616', 'اضافة فاتورة مشتريات', 'buyBillController.php', '6', '11', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3202', '13616', '1', '15392', '5', '240', '1200', '0', '', '2024-11-05 14:15:54', '15392','','','0','0','0','0','0',null,'240','1200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15392, 0, 0
                    , 240, 5, 0, 0, 77, '2024-11-05 14:15:55')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:15:55' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15392', '240', '5', '0', 'buyBillController.php', '31348', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15392 ;
UPDATE buybilldetail SET  quantitybefore = 4 WHERE buybilldetailid = 31348 ;
UPDATE product SET productName = 'R3202', productDescription = '', productCatId = '1', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-10', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3202',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '242',meanbuyprice_withDiscount = '242' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='252.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='244',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15392';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 242, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 242
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 244, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31348;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15392;
UPDATE storedetail SET  productquantity = '9', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15391';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15392', '1', '5', '0', '13616', 'اضافة فاتورة مشتريات', 'buyBillController.php', '4', '9', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06932', '13616', '5', '15822', '30', '230', '6900', '0', '', '2024-11-05 14:15:54', '15822','','','0','0','0','0','0',null,'230','6900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15822, 0, 0
                    , 230, 30, 0, 0, 77, '2024-11-05 14:15:55')
                ON DUPLICATE KEY UPDATE buyprice = 230,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 14:15:55' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15822', '230', '30', '0', 'buyBillController.php', '31349', '', '0', '0');
UPDATE product SET  productBuyPrice = "230" WHERE productId = 15822 ;
UPDATE buybilldetail SET  quantitybefore = 13 WHERE buybilldetailid = 31349 ;
UPDATE product SET productName = '6932', productDescription = '', productCatId = '5', productBuyPrice = '230.00', productSellAllPrice = '280.00', productSellUnitPrice = '280.00', productSellHalfPrice = '280.00', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06932',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '230',meanbuyprice_withDiscount = '230' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='230',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='230',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '15822';
UPDATE buybilldetail SET  lastbuyprice = 230 , meanbuyprice = 230, lastbuyprice_withDiscount = 230, meanbuyprice_withDiscount = 230
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where buybilldetailid = 31349;
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 15822;
UPDATE storedetail SET  productquantity = '43', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15822', '1', '30', '0', '13616', 'اضافة فاتورة مشتريات', 'buyBillController.php', '13', '43', '77', '2024-11-05 14:06:02','0','0');
UPDATE supplier SET  suppliercurrentDebt = '370390',suppliercurrentDebtInCurrency= '370390' , userid = '77', supplierdate = '2024-11-05 14:15:54'   WHERE supplierid = '78';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('78', '345040.00', '25350', '0', 'اضافة فاتورة مشتريات', '13616', '370390', '2024-11-05 14:06:02', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','25350','1','345040','25350','370390','0');
update buybill set dailyentryid='0,' where buybillid=13616;
COMMIT;
UPDATE product SET overAllAveragePrice = 250 WHERE productId = 15392;UPDATE product SET overAllAveragePrice = 240 WHERE productId = 15660;UPDATE product SET overAllAveragePrice = 145 WHERE productId = 15664;UPDATE product SET overAllAveragePrice = 155 WHERE productId = 15806;UPDATE product SET overAllAveragePrice = 230 WHERE productId = 15822;UPDATE product SET overAllAveragePrice = 270 WHERE productId = 15860;UPDATE product SET overAllAveragePrice = 250 WHERE productId = 15861;UPDATE product SET overAllAveragePrice = 250 WHERE productId = 15862;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:45:55";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:15:55", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 14:15:55', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13616');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:45:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:15:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:15:59', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:46:00";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:16:00", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 14:16:00', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13616&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:46:13";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:16:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:16:13', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143228');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:46:48";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:16:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:16:48', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143228 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143228 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143228;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 14:16:48', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143228';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34449;
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523542;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15589, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-285, sellCostMeanBuyPrice = sellCostMeanBuyPrice-285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-285
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-285, sellCostMeanBuyPrice = sellCostMeanBuyPrice-285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-285
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '23', userid = '2', storedetaildate = '2024-11-05 14:16:48' WHERE storedetailid = '15588';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15589', '1', '1', '0', '143228', 'تعديل فاتورة مبيعات', 'sellbillController.php', '22', '23', '2', '2024-11-05 14:06:38','0','0');
CALL clientInUse(8055,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1121', userid = '2' WHERE clientid = '8055';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8055','1495.00','374.00','1','تعديل فاتورة مبيعات','143228', '1121', '2024-11-05 14:06:38', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '374', '0', null, '0', null, null,'', '0','1','1','374','1','2024-11-05 14:06:38','0','0');
UPDATE client SET  inUse = 0 where clientid = 8055;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 374, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-374, sellCostBuyPrice =sellCostBuyPrice-285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-285, sellCostMeanBuyPrice = sellCostMeanBuyPrice-285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-285
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8055, '2024-11-05', 374, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-374, sellCostBuyPrice =sellCostBuyPrice-285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-285, sellCostMeanBuyPrice = sellCostMeanBuyPrice-285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-285
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 374, 285, 285
                    , 285, 285, 285, 285, 285, 285)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-374, netSellCostBuyPrice = netSellCostBuyPrice-285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-285;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143228 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143228 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(2357,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:06:38', '0672a0a4e99982', '2357', '0.00', '373', '0', '1', '373', '373', '0', '373', '1', '2024-11-05 14:06:38', '', '2', '0', 'سارة مبارك u42', '2', '1', '3', '91', 'سارة مبارك u42', '3', '143228', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '373', userid = '2' WHERE clientid = '2357';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2357','0.00','373','0','اضافة فاتورة مبيعات (معدله)','143233', '373', '2024-11-05 14:16:48', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '373', '0', null, '0', null, null,'', '0','1','1','374','1','2024-11-05 14:06:38','0','0');
UPDATE client SET  inUse = 0 where clientid = 2357;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34449;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3251', '143233', '1', '15589', '1', '350', '350', '0', '', '1', '2024-11-05 14:16:48', '15589', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34449-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523553;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15589, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '2', storedetaildate = '2024-11-05 14:16:48' WHERE storedetailid = '15588';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15589', '1', '1', '1', '143233', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '23', '22', '2', '2024-11-05 14:16:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143233', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:16:48', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143233', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 14:16:48', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 373, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+373, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2357, '2024-11-05', 373, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+373, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 373, 285, 285
                    , 285, 285, 285, 285, 285, 285)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+373, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+285;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143228 and newid=143233 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:46:49";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:16:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:16:49', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143233');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:46:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:16:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 14:16:57', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:47:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:17:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 14:17:09', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:47:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:17:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:17:42', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143232');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:49:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:19:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:19:05', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:49:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:19:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:19:16', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:49:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:19:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:19:20', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'قطن', '', '20', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '23555',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('23575.00','20', '1', '1', 'إضافة مصروف', '24279', '23555', '2024-11-05 14:19:20', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'قطن', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24279';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:49:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:19:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:19:21', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:49:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:19:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:19:23', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:49:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:19:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:19:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:50:46";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:20:46", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:20:46', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0c30e802a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8055,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:14:40', '0672a0c30e802a', '8055', '1121.00', '1419', '0', '1', '298.00', '298', '0', '298', '1', '2024-11-05 14:20:46', '', '75', '0', 'مدام سحر محمود W231', '2', '1', '3', '83', 'مدام سحر محمود W231', '2' ,'0','','','','','-1','0','0','0','0','0','298','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1419', userid = '75' WHERE clientid = '8055';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8055','1121.00','298','0','اضافة فاتورة مبيعات','143234', '1419', '2024-11-05 14:20:46', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '298', '0', null, '0', null, null,'', '0','1','1','298','1','2024-11-05 14:14:40','0','0');
UPDATE client SET  inUse = 0 where clientid = 8055;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28998;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','05827', '143234', '5', '12927', '1', '295', '295', '0', '', '1', '2024-11-05 14:20:46', '12927', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28998-1,','1','1','0','0','295','295','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        
                where sellbilldetailid = 523556;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12927, '2024-11-05', 295, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 295, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 14:20:46' WHERE storedetailid = '12926';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12927', '1', '1', '1', '143234', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 14:20:46','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143234', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 14:20:46', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 8055;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 298, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+298, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8055, '2024-11-05', 298, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+298, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 298, 410, 410
                    , 410, 410, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+298, netSellCostBuyPrice = netSellCostBuyPrice+410
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+410
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+410
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+410
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+410
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+410
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0c30e802a and sellbillId = 143234 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:50:47";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:20:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:20:47', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:51:00";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:21:00", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 14:21:00', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13616&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:51:33";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:21:33", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:21:33', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a08ef85153
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1551,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:00:47', '0672a08ef85153', '1551', '0.00', '303', '0', '1', '303.00', '303', '0', '303', '1', '2024-11-05 14:21:33', '', '75', '0', 'ام ملك الاسماعلية d1', '2', '1', '3', '81', 'ام ملك الاسماعلية d1', '4' ,'0','','','','','-1','0','0','0','0','0','303','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '303', userid = '75' WHERE clientid = '1551';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1551','0.00','303','0','اضافة فاتورة مبيعات','143235', '303', '2024-11-05 14:21:33', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '303', '0', null, '0', null, null,'', '0','1','1','303','1','2024-11-05 14:00:47','0','0');
UPDATE client SET  inUse = 0 where clientid = 1551;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31738;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06272', '143235', '5', '14252', '1', '90', '90', '0', '', '1', '2024-11-05 14:21:33', '14252', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31738-1,','1','1','0','0','90','90','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523558;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14252, '2024-11-05', 90, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+90, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 90, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+90, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 14:21:33' WHERE storedetailid = '14251';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14252', '1', '1', '1', '143235', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 14:21:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30917;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','B1190', '143235', '2', '13467', '1', '190', '190', '0', '', '1', '2024-11-05 14:21:33', '13467', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30917-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523559;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13467, '2024-11-05', 190, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-05 14:21:33' WHERE storedetailid = '13466';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13467', '1', '1', '1', '143235', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-05 14:21:33','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143235', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:21:33', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143235', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 14:21:33', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 1551;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 303, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1551, '2024-11-05', 303, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 303, 500, 500
                    , 500, 500, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+303, netSellCostBuyPrice = netSellCostBuyPrice+500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+500
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+500
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+500
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+500
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a08ef85153 and sellbillId = 143235 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:51:34";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:21:34", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:21:34', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:51:52";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:21:52", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 14:21:52', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:52:05";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:22:05", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 14:22:05', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:52:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:22:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:22:23', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0d4ed1437
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:19:26', '0672a0d4ed1437', '1', '0.00', '0', '35', '1', '3641.00', '3606', '3606', '0', '1', '2024-11-05 14:22:23', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','3606','0','','0','0','3606','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143236', '0', '2024-11-05 14:22:23', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3606', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:19:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34339;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','H1308', '143236', '14', '15393', '1', '475', '475', '0', '', '1', '2024-11-05 14:22:23', '15393', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34339-1,','1','1','0','0','475','475','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 523562;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15393, '2024-11-05', 470.43394671793, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470.43394671793, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 470.43394671793, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470.43394671793, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 14:22:23' WHERE storedetailid = '15392';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15393', '1', '1', '1', '143236', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 14:22:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','H1408', '143236', '14', '15693', '1', '600', '600', '0', '', '1', '2024-11-05 14:22:23', '15693', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34605-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 523563;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15693, '2024-11-05', 594.23235374897, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+594.23235374897, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 594.23235374897, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+594.23235374897, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '9', storedetaildate = '2024-11-05 14:22:23' WHERE storedetailid = '15692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15693', '1', '1', '1', '143236', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '21', '9', '2024-11-05 14:22:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34201;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1356', '143236', '14', '15475', '1', '650', '650', '0', '', '1', '2024-11-05 14:22:24', '15475', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34201-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 591, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 523564;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15475, '2024-11-05', 643.75171656138, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+643.75171656138, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 643.75171656138, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+643.75171656138, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-05 14:22:24' WHERE storedetailid = '15474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15475', '1', '1', '1', '143236', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-05 14:22:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143236', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-05 14:22:24', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523565;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-05', 475.38588299918, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+475.38588299918, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 475.38588299918, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+475.38588299918, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '52', userid = '9', storedetaildate = '2024-11-05 14:22:24' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143236', 'اضافة فاتورة مبيعات', 'sellbillController.php', '53', '52', '9', '2024-11-05 14:22:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34770;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','0K791', '143236', '7', '15784', '1', '240', '240', '0', '', '1', '2024-11-05 14:22:24', '15784', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34770-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 523566;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15784, '2024-11-05', 237.69294149959, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+237.69294149959, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 237.69294149959, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+237.69294149959, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 14:22:24' WHERE storedetailid = '15783';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15784', '1', '1', '1', '143236', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 14:22:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34007;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','06761', '143236', '5', '15332', '1', '410', '410', '0', '', '1', '2024-11-05 14:22:24', '15332', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34007-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 523567;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15332, '2024-11-05', 406.0587750618, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+406.0587750618, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 406.0587750618, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+406.0587750618, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 14:22:24' WHERE storedetailid = '15331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15332', '1', '1', '1', '143236', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 14:22:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34492;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143236', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-05 14:22:24', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34492-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 232.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 232.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 207, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523568;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-05', 287.212304312, 230, 230
                    , 232, 230, 232, 238.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+287.212304312, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+232
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 287.212304312, 230, 230
                    , 232, 230, 232, 238.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+287.212304312, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+232
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '54', userid = '9', storedetaildate = '2024-11-05 14:22:24' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143236', 'اضافة فاتورة مبيعات', 'sellbillController.php', '55', '54', '9', '2024-11-05 14:22:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31224;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('445','06172', '143236', '5', '14051', '1', '460', '460', '0', '', '1', '2024-11-05 14:22:24', '14051', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31224-1,','1','1','0','0','460','460','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 445.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 445.00
        
                where sellbilldetailid = 523569;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14051, '2024-11-05', 455.57813787421, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455.57813787421, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 455.57813787421, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455.57813787421, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 14:22:24' WHERE storedetailid = '14050';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14051', '1', '1', '1', '143236', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 14:22:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143236', '17', '10291', '1', '36', '36', '0', '', '1', '2024-11-05 14:22:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','36','36','0','','0','0.00','0','0','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '27161',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('23555','3606', '0', '1', 'اضافة فاتورة مبيعات', '143236', '27161', '2024-11-05 14:22:24', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 3606, 3105, 3105
                    , 3107, 3105, 3107, 3113.18
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1945, 1938, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3606, sellCostBuyPrice =sellCostBuyPrice+3105
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3105, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3107
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3105, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3107
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3113.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1945
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1938
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 3606, 3105, 3105
                    , 3107, 3105, 3107, 3113.18
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1945, 1938, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3606, sellCostBuyPrice =sellCostBuyPrice+3105
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3105, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3107
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3105, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3107
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3113.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1945
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1938
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3606, 3105, 3105
                    , 3107, 3105, 3107, 3113.18, 1945, 1938)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3606, netSellCostBuyPrice = netSellCostBuyPrice+3105
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3105
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3107
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3105
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3107
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3113.18
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1945
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1938;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0d4ed1437 and sellbillId = 143236 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:52:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:22:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:22:24', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:52:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:22:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 14:22:29', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:53:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:23:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 14:23:03', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','2', '3606', '2024-11-05', '9', '0', '0','','1','1','0','0','3606');
UPDATE save SET  savecurrentvalue = '23555',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27161.00','3606', '1', '1', 'تحويل امول الى الخزنة  [ فودافون كاش ] ', '3307', '23555', '2024-11-05 14:23:03', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '156218.5',  userid = '9' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('152612.50','3606', '0', '2', 'تحويل امول من الخزنة  [ نقدي ] ', '3307', '156218.5', '2024-11-05 14:23:03', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '2', transfermoneyvalue = '3606.00', transfermoneydate = '2024-11-05', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='3606' WHERE transfermoneyid = '3307';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:53:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:23:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 14:23:04', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:53:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:23:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 14:23:05', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:53:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:23:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:23:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:53:16";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:23:16", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:23:16', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0dce2321d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7674,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:21:34', '0672a0dce2321d', '7674', '0.00', '505', '0', '1', '505.00', '505', '0', '505', '1', '2024-11-05 14:23:16', '', '75', '0', 'امنية اسعد الغردقة E500', '2', '1', '3', '78', 'امنية اسعد الغردقة E500', '3' ,'0','','','','','-1','0','0','0','0','0','505','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '505', userid = '75' WHERE clientid = '7674';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7674','0.00','505','0','اضافة فاتورة مبيعات','143237', '505', '2024-11-05 14:23:16', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '505', '0', null, '0', null, null,'', '0','1','1','505','1','2024-11-05 14:21:34','0','0');
UPDATE client SET  inUse = 0 where clientid = 7674;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34612;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','06854', '143237', '5', '15586', '1', '480', '480', '0', '', '1', '2024-11-05 14:23:16', '15586', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34612-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523571;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15586, '2024-11-05', 480, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 14:23:16' WHERE storedetailid = '15585';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15586', '1', '1', '1', '143237', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 14:23:16','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143237', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:23:16', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143237', '17', '10291', '1', '5', '5', '0', '', '1', '2024-11-05 14:23:16', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','5','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 78 where clientid = 7674;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 505, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,410, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+505, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7674, '2024-11-05', 505, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,410, 430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+505, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 505, 410, 410
                    , 410, 410, 410, 410, 410, 430)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+505, netSellCostBuyPrice = netSellCostBuyPrice+410
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+410
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+410
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+410
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+410
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+410
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+410
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+430;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0dce2321d and sellbillId = 143237 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:53:17";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:23:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:23:17', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:53:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:23:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:23:28', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0e2b224fc
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:23:07', '0672a0e2b224fc', '1', '0.00', '0', '0', '1', '290.00', '290', '290', '0', '1', '2024-11-05 14:23:28', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','290','0','','0','0','290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143238', '0', '2024-11-05 14:23:28', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '290', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:23:07','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34852;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','H1450', '143238', '14', '15831', '1', '290', '290', '0', '', '1', '2024-11-05 14:23:28', '15831', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34852-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523574;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15831, '2024-11-05', 290, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-05 14:23:28' WHERE storedetailid = '15830';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15831', '1', '1', '1', '143238', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-05 14:23:28','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '23845',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('23555','290', '0', '1', 'اضافة فاتورة مبيعات', '143238', '23845', '2024-11-05 14:23:28', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 290, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 290, 245, 245
                    , 245, 245, 245, 245, 245, 245)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+290, netSellCostBuyPrice = netSellCostBuyPrice+245
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+245
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+245
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+245
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+245
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+245
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+245
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+245;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0e2b224fc and sellbillId = 143238 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:53:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:23:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:23:29', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:54:17";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:24:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:24:17', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0d9f4c47c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4713,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:20:47', '0672a0d9f4c47c', '4713', '0.00', '626', '0', '1', '626.00', '626', '0', '626', '1', '2024-11-05 14:24:17', '', '75', '0', 'نانا هلال E230', '2', '1', '3', '78', 'نانا هلال E230', '4' ,'0','','','','','-1','0','0','0','0','0','626','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '626', userid = '75' WHERE clientid = '4713';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4713','0.00','626','0','اضافة فاتورة مبيعات','143239', '626', '2024-11-05 14:24:17', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '626', '0', null, '0', null, null,'', '0','1','1','626','1','2024-11-05 14:20:47','0','0');
UPDATE client SET  inUse = 0 where clientid = 4713;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34571;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06875', '143239', '5', '15676', '1', '300', '300', '0', '', '1', '2024-11-05 14:24:17', '15676', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34571-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523575;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15676, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 14:24:17' WHERE storedetailid = '15675';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15676', '1', '1', '1', '143239', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 14:24:17','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34353;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06822', '143239', '5', '15527', '1', '300', '300', '0', '', '1', '2024-11-05 14:24:17', '15527', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34353-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 523576;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15527, '2024-11-05', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 14:24:17' WHERE storedetailid = '15526';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15527', '1', '1', '1', '143239', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 14:24:17','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143239', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:24:17', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143239', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-05 14:24:17', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 78 where clientid = 4713;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 626, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+626, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4713, '2024-11-05', 626, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+626, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 626, 490, 490
                    , 490, 490, 490, 490, 240, 240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+626, netSellCostBuyPrice = netSellCostBuyPrice+490
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+490
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+490
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+490
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+490
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+490
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0d9f4c47c and sellbillId = 143239 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:54:18";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:24:18", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:24:18', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:54:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:24:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:24:59', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a025032f90
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:32:32', '0672a025032f90', '1', '0.00', '0', '0', '1', '200.00', '200', '200', '0', '1', '2024-11-05 14:25:00', '', '9', '0', 'نقدي', '1', '0', '3', '3', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','200','0','','0','0','200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143240', '0', '2024-11-05 14:25:00', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '200', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 13:32:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34732;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06915', '143240', '5', '15765', '1', '200', '200', '0', '', '1', '2024-11-05 14:25:00', '15765', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34732-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 150, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523579;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15765, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 14:25:00' WHERE storedetailid = '15764';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15765', '1', '1', '1', '143240', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 14:25:00','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '24045',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('23845','200', '0', '1', 'اضافة فاتورة مبيعات', '143240', '24045', '2024-11-05 14:25:00', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 3 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 200, 150, 150
                    , 150, 150, 150, 150, 150, 150)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+200, netSellCostBuyPrice = netSellCostBuyPrice+150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+150
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+150
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+150
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+150
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+150
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+150
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+150;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a025032f90 and sellbillId = 143240 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:55:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:25:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:25:00', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:57:48";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:27:48", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:27:48', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0e72778a2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9336,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:24:18', '0672a0e72778a2', '9336', '0.00', '1141', '0', '1', '1141.00', '1141', '0', '1141', '1', '2024-11-05 14:27:48', '', '75', '0', 'امل بكر e445', '2', '1', '3', '78', 'امل بكر e445', '5' ,'0','','','','','-1','0','0','0','0','0','1141','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1141', userid = '75' WHERE clientid = '9336';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9336','0.00','1141','0','اضافة فاتورة مبيعات','143241', '1141', '2024-11-05 14:27:48', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1141', '0', null, '0', null, null,'', '0','1','1','1141','1','2024-11-05 14:24:18','0','0');
UPDATE client SET  inUse = 0 where clientid = 9336;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33581;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','06661', '143241', '5', '15151', '1', '185', '185', '0', '', '1', '2024-11-05 14:27:48', '15151', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33581-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        
                where sellbilldetailid = 523580;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15151, '2024-11-05', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-05 14:27:48' WHERE storedetailid = '15150';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15151', '1', '1', '1', '143241', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-05 14:27:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33543;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3045', '143241', '1', '14725', '1', '310', '310', '0', '', '1', '2024-11-05 14:27:48', '14725', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33543-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523581;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14725, '2024-11-05', 310, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 14:27:48' WHERE storedetailid = '14724';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14725', '1', '1', '1', '143241', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 14:27:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34699;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','H1420', '143241', '14', '15748', '1', '620', '620', '0', '', '1', '2024-11-05 14:27:48', '15748', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34699-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 523582;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15748, '2024-11-05', 620, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 510, 510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+510
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 510, 510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+510
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-05 14:27:48' WHERE storedetailid = '15747';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15748', '1', '1', '1', '143241', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-05 14:27:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143241', '9', '2015', '1', '15', '15', '0', '', '1', '2024-11-05 14:27:48', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143241', '17', '10291', '1', '11', '11', '0', '', '1', '2024-11-05 14:27:48', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11','11','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 78 where clientid = 9336;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1141, 905, 905
                    , 905, 905, 905, 905
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,510, 510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1141, sellCostBuyPrice =sellCostBuyPrice+905
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+905, sellCostMeanBuyPrice = sellCostMeanBuyPrice+905
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+905, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+905
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+905
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+510
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9336, '2024-11-05', 1141, 905, 905
                    , 905, 905, 905, 905
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,510, 510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1141, sellCostBuyPrice =sellCostBuyPrice+905
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+905, sellCostMeanBuyPrice = sellCostMeanBuyPrice+905
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+905, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+905
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+905
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+510
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1141, 905, 905
                    , 905, 905, 905, 905, 510, 510)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1141, netSellCostBuyPrice = netSellCostBuyPrice+905
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+905
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+905
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+905
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+905
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+905
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+510
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+510;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0e72778a2 and sellbillId = 143241 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:57:49";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:27:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:27:49', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:59:17";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:29:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:29:17', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0f4598d07
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10140,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:27:49', '0672a0f4598d07', '10140', '0.00', '313', '0', '1', '313.00', '313', '0', '313', '1', '2024-11-05 14:29:17', '', '75', '0', 'ميرا هاشم 43', '2', '1', '3', '89', 'ميرا هاشم 43', '3' ,'0','','','','','-1','0','0','0','0','0','313','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '313', userid = '75' WHERE clientid = '10140';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10140','0.00','313','0','اضافة فاتورة مبيعات','143242', '313', '2024-11-05 14:29:17', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '313', '0', null, '0', null, null,'', '0','1','1','313','1','2024-11-05 14:27:49','0','0');
UPDATE client SET  inUse = 0 where clientid = 10140;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30326;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','R2662', '143242', '1', '13068', '1', '290', '290', '0', '', '1', '2024-11-05 14:29:17', '13068', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30326-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 236.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 236.00
        
                where sellbilldetailid = 523585;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13068, '2024-11-05', 290, 230, 230
                    , 236, 230, 236, 231.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+231.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 230, 230
                    , 236, 230, 236, 231.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+231.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '75', storedetaildate = '2024-11-05 14:29:17' WHERE storedetailid = '13067';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13068', '1', '1', '1', '143242', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '75', '2024-11-05 14:29:17','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143242', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:29:17', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143242', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 14:29:17', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 10140;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 313, 230, 230
                    , 236, 230, 236, 231.3
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+313, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+231.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10140, '2024-11-05', 313, 230, 230
                    , 236, 230, 236, 231.3
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+313, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+231.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 313, 230, 230
                    , 236, 230, 236, 231.3, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+313, netSellCostBuyPrice = netSellCostBuyPrice+230
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+230
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+236
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+230
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+236
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+231.3
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0f4598d07 and sellbillId = 143242 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 10:59:18";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:29:18", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:29:18', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:00:10";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:30:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:30:10', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235803
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(665,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '430' , clientdate = '2024-11-05 14:30:10', userid = '2' WHERE clientid = '665';
UPDATE client SET  inUse = 0 where clientid = 665;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('665','2080.00','1650','1','ايصال تحصيل (( قبض من عميل ))','235803', '430', '2024-11-05 14:19:16', '2', 'clientPayedDeptController.php', '   ', '1650', '0', null, '0', null, null,'', '-1','1','1','1650','1','','767','0');
UPDATE save SET  savecurrentvalue = '157868.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('156218.50','1650', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235812', '157868.5', '2024-11-05 14:30:10', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('رانيا راغب y48', 'رانيا راغب y48', 'رانيا راغب y48', 'رانيا راغب y48', '58', '0', '430.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:30:11');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1650', '1650', '2024-11-05', '2', '0', '0', '2024-11-05 14:30:11','اضافة ايصال سداد للعميل رانيا راغب y48','1','0','0','0','235812','clientPayedDeptController.php?do=show&id=235812');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118916', '-1', '1650', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1650', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118916', '11188', '1650', '','0');
UPDATE accountstree SET name = 'رانيا راغب y48', customName = 'رانيا راغب y48', customNameEn = 'رانيا راغب y48', nameEn = 'رانيا راغب y48', parent = '58', accountNature = '0', theValue = '-1220', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:30:11' WHERE id = '11188';
UPDATE clientdebtchange SET clientid = '665', clientdebtchangebefore = '2080.000', clientdebtchangeamount = '1650.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235803', clientdebtchangeafter = '430.000', clientdebtchangedate = '2024-11-05 14:19:16', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1650.00',discount='', reciptid='0', dailyentryid = '118916',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1650',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235812';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235803 -clientdebtchangeId = 235812
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:00:11";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:30:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:30:11', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:00:13";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:30:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:30:13', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:00:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:30:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:30:47', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0e9ce6e0c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:25:00', '0672a0e9ce6e0c', '1', '0.00', '0', '0', '1', '410.00', '410', '410', '0', '1', '2024-11-05 14:30:47', '', '9', '0', 'نقدي', '1', '0', '3', '3', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','410','0','','0','0','410','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143243', '0', '2024-11-05 14:30:47', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '410', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:25:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20301;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','H1020', '143243', '14', '9354', '1', '410', '410', '0', '', '1', '2024-11-05 14:30:47', '9354', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20301-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 262.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 262.00
        
                where sellbilldetailid = 523588;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9354, '2024-11-05', 410, 285, 285
                    , 262, 285, 262, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 410, 285, 285
                    , 262, 285, 262, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 14:30:47' WHERE storedetailid = '9353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9354', '1', '1', '1', '143243', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-05 14:30:47','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '24455',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('24045','410', '0', '1', 'اضافة فاتورة مبيعات', '143243', '24455', '2024-11-05 14:30:47', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 3 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 410, 285, 285
                    , 262, 285, 262, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 410, 285, 285
                    , 262, 285, 262, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 410, 285, 285
                    , 262, 285, 262, 285, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+410, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+262
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+262
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0e9ce6e0c and sellbillId = 143243 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:00:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:30:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:30:48', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:01:11";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:31:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:31:12', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:01:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:31:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:31:39', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235814
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8774,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '9' , clientdate = '2024-11-05 14:31:39', userid = '2' WHERE clientid = '8774';
UPDATE client SET  inUse = 0 where clientid = 8774;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8774','772.00','763','1','ايصال تحصيل (( قبض من عميل ))','235814', '9', '2024-11-05 14:31:12', '2', 'clientPayedDeptController.php', '   ', '763', '0', null, '0', null, null,'', '-1','1','1','763','1','','768','0');
UPDATE save SET  savecurrentvalue = '158631.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('157868.50','763', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235814', '158631.5', '2024-11-05 14:31:39', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اسراء ابراهيم E5', 'اسراء ابراهيم E5', 'اسراء ابراهيم E5', 'اسراء ابراهيم E5', '58', '0', '9.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:31:39');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '763', '763', '2024-11-05', '2', '0', '0', '2024-11-05 14:31:39','اضافة ايصال سداد للعميل اسراء ابراهيم E5','1','0','0','0','235814','clientPayedDeptController.php?do=show&id=235814');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118917', '-1', '763', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '763', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118917', '11189', '763', '','0');
UPDATE accountstree SET name = 'اسراء ابراهيم E5', customName = 'اسراء ابراهيم E5', customNameEn = 'اسراء ابراهيم E5', nameEn = 'اسراء ابراهيم E5', parent = '58', accountNature = '0', theValue = '-754', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:31:39' WHERE id = '11189';
UPDATE clientdebtchange SET clientid = '8774', clientdebtchangebefore = '772.000', clientdebtchangeamount = '763.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235814', clientdebtchangeafter = '9.000', clientdebtchangedate = '2024-11-05 14:31:12', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '763.00',discount='', reciptid='0', dailyentryid = '118917',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='763',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235814';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235814 -clientdebtchangeId = 235814
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:01:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:31:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:31:40', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:02:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:32:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:32:04', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235815
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10191,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 14:32:04', userid = '2' WHERE clientid = '10191';
UPDATE client SET  inUse = 0 where clientid = 10191;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10191','2086.00','2086','1','ايصال تحصيل (( قبض من عميل ))','235815', '0', '2024-11-05 14:31:40', '2', 'clientPayedDeptController.php', '   ', '2086', '0', null, '0', null, null,'', '-1','1','1','2086','1','','769','0');
UPDATE save SET  savecurrentvalue = '160717.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('158631.50','2086', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235815', '160717.5', '2024-11-05 14:32:04', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2086', '2086', '2024-11-05', '2', '0', '0', '2024-11-05 14:32:04','اضافة ايصال سداد للعميل ايه نبيل صفوت','1','0','0','0','235815','clientPayedDeptController.php?do=show&id=235815');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118918', '-1', '2086', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2086', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118918', '10635', '2086', '','0');
UPDATE accountstree SET name = 'ايه نبيل صفوت', customName = 'ايه نبيل صفوت', customNameEn = 'ايه نبيل صفوت', nameEn = 'ايه نبيل صفوت', parent = '58', accountNature = '0', theValue = '-2086', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-10-25 11:57:46' WHERE id = '10635';
UPDATE clientdebtchange SET clientid = '10191', clientdebtchangebefore = '2086.000', clientdebtchangeamount = '2086.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235815', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 14:31:40', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2086.00',discount='', reciptid='0', dailyentryid = '118918',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2086',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235815';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235815 -clientdebtchangeId = 235815
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:02:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:32:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:32:05', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:02:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:32:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:32:33', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235816
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1979,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 14:32:33', userid = '2' WHERE clientid = '1979';
UPDATE client SET  inUse = 0 where clientid = 1979;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1979','1667.00','1667','1','ايصال تحصيل (( قبض من عميل ))','235816', '0', '2024-11-05 14:32:05', '2', 'clientPayedDeptController.php', '   ', '1667', '0', null, '0', null, null,'', '-1','1','1','1667','1','','770','0');
UPDATE save SET  savecurrentvalue = '162384.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('160717.50','1667', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235816', '162384.5', '2024-11-05 14:32:33', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('يارا اسكندرية 58', 'يارا اسكندرية 58', 'يارا اسكندرية 58', 'يارا اسكندرية 58', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:32:33');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1667', '1667', '2024-11-05', '2', '0', '0', '2024-11-05 14:32:33','اضافة ايصال سداد للعميل يارا اسكندرية 58','1','0','0','0','235816','clientPayedDeptController.php?do=show&id=235816');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118919', '-1', '1667', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1667', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118919', '11190', '1667', '','0');
UPDATE accountstree SET name = 'يارا اسكندرية 58', customName = 'يارا اسكندرية 58', customNameEn = 'يارا اسكندرية 58', nameEn = 'يارا اسكندرية 58', parent = '58', accountNature = '0', theValue = '-1667', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:32:33' WHERE id = '11190';
UPDATE clientdebtchange SET clientid = '1979', clientdebtchangebefore = '1667.000', clientdebtchangeamount = '1667.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235816', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 14:32:05', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1667.00',discount='', reciptid='0', dailyentryid = '118919',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1667',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235816';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235816 -clientdebtchangeId = 235816
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:02:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:32:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:32:33', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:03:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:33:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:33:30', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235817
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7264,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '384' , clientdate = '2024-11-05 14:33:30', userid = '2' WHERE clientid = '7264';
UPDATE client SET  inUse = 0 where clientid = 7264;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7264','2868.00','2484','1','ايصال تحصيل (( قبض من عميل ))','235817', '384', '2024-11-05 14:32:33', '2', 'clientPayedDeptController.php', '   ', '2484', '0', null, '0', null, null,'', '-1','1','1','2484','1','','771','0');
UPDATE save SET  savecurrentvalue = '164868.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('162384.50','2484', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235817', '164868.5', '2024-11-05 14:33:30', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اية نبيل اسماعلية y12', 'اية نبيل اسماعلية y12', 'اية نبيل اسماعلية y12', 'اية نبيل اسماعلية y12', '58', '0', '384.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:33:30');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2484', '2484', '2024-11-05', '2', '0', '0', '2024-11-05 14:33:30','اضافة ايصال سداد للعميل اية نبيل اسماعلية y12','1','0','0','0','235817','clientPayedDeptController.php?do=show&id=235817');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118920', '-1', '2484', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2484', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118920', '11191', '2484', '','0');
UPDATE accountstree SET name = 'اية نبيل اسماعلية y12', customName = 'اية نبيل اسماعلية y12', customNameEn = 'اية نبيل اسماعلية y12', nameEn = 'اية نبيل اسماعلية y12', parent = '58', accountNature = '0', theValue = '-2100', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:33:30' WHERE id = '11191';
UPDATE clientdebtchange SET clientid = '7264', clientdebtchangebefore = '2868.000', clientdebtchangeamount = '2484.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235817', clientdebtchangeafter = '384.000', clientdebtchangedate = '2024-11-05 14:32:33', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2484.00',discount='', reciptid='0', dailyentryid = '118920',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2484',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235817';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235817 -clientdebtchangeId = 235817
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:03:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:33:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:33:31', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:04:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:34:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:34:27', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235818
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10275,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1518' , clientdate = '2024-11-05 14:34:27', userid = '2' WHERE clientid = '10275';
UPDATE client SET  inUse = 0 where clientid = 10275;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10275','2298.00','780','1','ايصال تحصيل (( قبض من عميل ))','235818', '1518', '2024-11-05 14:33:31', '2', 'clientPayedDeptController.php', '   ', '780', '0', null, '0', null, null,'', '-1','1','1','780','1','','772','0');
UPDATE save SET  savecurrentvalue = '165648.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('164868.50','780', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235818', '165648.5', '2024-11-05 14:34:27', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '780', '780', '2024-11-05', '2', '0', '0', '2024-11-05 14:34:27','اضافة ايصال سداد للعميل تيا فاشون 52','1','0','0','0','235818','clientPayedDeptController.php?do=show&id=235818');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118921', '-1', '780', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '780', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118921', '11159', '780', '','0');
UPDATE accountstree SET name = 'تيا فاشون 52', customName = 'تيا فاشون 52', customNameEn = 'تيا فاشون 52', nameEn = 'تيا فاشون 52', parent = '58', accountNature = '0', theValue = '-780', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-04 15:11:55' WHERE id = '11159';
UPDATE clientdebtchange SET clientid = '10275', clientdebtchangebefore = '2298.000', clientdebtchangeamount = '780.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235818', clientdebtchangeafter = '1518.000', clientdebtchangedate = '2024-11-05 14:33:31', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '780.00',discount='', reciptid='0', dailyentryid = '118921',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='780',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235818';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235818 -clientdebtchangeId = 235818
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:04:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:34:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:34:28', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:05:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:35:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:35:08', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235819
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6554,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 14:35:08', userid = '2' WHERE clientid = '6554';
UPDATE client SET  inUse = 0 where clientid = 6554;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6554','4227.00','4227','1','ايصال تحصيل (( قبض من عميل ))','235819', '0', '2024-11-05 14:34:28', '2', 'clientPayedDeptController.php', '   ', '4227', '0', null, '0', null, null,'', '-1','1','1','4227','1','','773','0');
UPDATE save SET  savecurrentvalue = '169875.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('165648.50','4227', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235819', '169875.5', '2024-11-05 14:35:08', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4227', '4227', '2024-11-05', '2', '0', '0', '2024-11-05 14:35:08','اضافة ايصال سداد للعميل انجيل ستور G2','1','0','0','0','235819','clientPayedDeptController.php?do=show&id=235819');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118922', '-1', '4227', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '4227', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118922', '-1', '4227', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-4227', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '6554', clientdebtchangebefore = '4227.000', clientdebtchangeamount = '4227.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235819', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 14:34:28', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '4227.00',discount='', reciptid='0', dailyentryid = '118922',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='4227',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235819';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235819 -clientdebtchangeId = 235819
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:05:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:35:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:35:09', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:05:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:35:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:35:59', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235820
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(308,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 14:35:59', userid = '2' WHERE clientid = '308';
UPDATE client SET  inUse = 0 where clientid = 308;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('308','220.00','220','1','ايصال تحصيل (( قبض من عميل ))','235820', '0', '2024-11-05 14:35:09', '2', 'clientPayedDeptController.php', '   ', '220', '0', null, '0', null, null,'', '-1','1','1','220','1','','774','0');
UPDATE save SET  savecurrentvalue = '170095.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('169875.50','220', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235820', '170095.5', '2024-11-05 14:35:59', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '220', '220', '2024-11-05', '2', '0', '0', '2024-11-05 14:35:59','اضافة ايصال سداد للعميل ايهاب نجيب w51','1','0','0','0','235820','clientPayedDeptController.php?do=show&id=235820');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118923', '-1', '220', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '220', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118923', '-1', '220', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-220', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '308', clientdebtchangebefore = '220.000', clientdebtchangeamount = '220.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235820', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 14:35:09', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '220.00',discount='', reciptid='0', dailyentryid = '118923',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='220',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235820';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235820 -clientdebtchangeId = 235820
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:06:00";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:36:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:36:00', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:07:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:37:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:37:27', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235821
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9495,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '400' , clientdate = '2024-11-05 14:37:27', userid = '2' WHERE clientid = '9495';
UPDATE client SET  inUse = 0 where clientid = 9495;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9495','1452.00','1052','1','ايصال تحصيل (( قبض من عميل ))','235821', '400', '2024-11-05 14:36:00', '2', 'clientPayedDeptController.php', '   ', '1052', '0', null, '0', null, null,'', '-1','1','1','1052','1','','775','0');
UPDATE save SET  savecurrentvalue = '171147.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('170095.50','1052', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235821', '171147.5', '2024-11-05 14:37:27', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مريم غالي I334', 'مريم غالي I334', 'مريم غالي I334', 'مريم غالي I334', '58', '0', '400.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:37:27');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1052', '1052', '2024-11-05', '2', '0', '0', '2024-11-05 14:37:27','اضافة ايصال سداد للعميل مريم غالي I334','1','0','0','0','235821','clientPayedDeptController.php?do=show&id=235821');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118924', '-1', '1052', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1052', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118924', '11192', '1052', '','0');
UPDATE accountstree SET name = 'مريم غالي I334', customName = 'مريم غالي I334', customNameEn = 'مريم غالي I334', nameEn = 'مريم غالي I334', parent = '58', accountNature = '0', theValue = '-652', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:37:27' WHERE id = '11192';
UPDATE clientdebtchange SET clientid = '9495', clientdebtchangebefore = '1452.000', clientdebtchangeamount = '1052.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235821', clientdebtchangeafter = '400.000', clientdebtchangedate = '2024-11-05 14:36:00', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1052.00',discount='', reciptid='0', dailyentryid = '118924',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1052',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235821';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235821 -clientdebtchangeId = 235821
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:07:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:37:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:37:28', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:08:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:38:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:38:02', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235822
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9961,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '324' , clientdate = '2024-11-05 14:38:02', userid = '2' WHERE clientid = '9961';
UPDATE client SET  inUse = 0 where clientid = 9961;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9961','1697.00','1373','1','ايصال تحصيل (( قبض من عميل ))','235822', '324', '2024-11-05 14:37:28', '2', 'clientPayedDeptController.php', '   ', '1373', '0', null, '0', null, null,'', '-1','1','1','1373','1','','776','0');
UPDATE save SET  savecurrentvalue = '172520.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('171147.50','1373', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235822', '172520.5', '2024-11-05 14:38:02', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('سارة رجب حسن 12', 'سارة رجب حسن 12', 'سارة رجب حسن 12', 'سارة رجب حسن 12', '58', '0', '324.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:38:02');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1373', '1373', '2024-11-05', '2', '0', '0', '2024-11-05 14:38:02','اضافة ايصال سداد للعميل سارة رجب حسن 12','1','0','0','0','235822','clientPayedDeptController.php?do=show&id=235822');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118925', '-1', '1373', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1373', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118925', '11193', '1373', '','0');
UPDATE accountstree SET name = 'سارة رجب حسن 12', customName = 'سارة رجب حسن 12', customNameEn = 'سارة رجب حسن 12', nameEn = 'سارة رجب حسن 12', parent = '58', accountNature = '0', theValue = '-1049', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:38:02' WHERE id = '11193';
UPDATE clientdebtchange SET clientid = '9961', clientdebtchangebefore = '1697.000', clientdebtchangeamount = '1373.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235822', clientdebtchangeafter = '324.000', clientdebtchangedate = '2024-11-05 14:37:28', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1373.00',discount='', reciptid='0', dailyentryid = '118925',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1373',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235822';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235822 -clientdebtchangeId = 235822
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:08:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:38:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:38:02', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:08:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:38:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 14:38:45', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:08:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:38:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 14:38:56', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:09:10";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:39:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2024-11-05 14:39:10', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnsellbillController.php?do=showDetail&returnsellbillid=15679');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:09:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:39:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:39:18', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0ff8a4e21
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:30:48', '0672a0ff8a4e21', '1', '0.00', '0', '0', '1', '480.00', '480', '480', '0', '1', '2024-11-05 14:39:18', '', '9', '0', 'نقدي', '1', '0', '3', '21', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','480','0','','0','0','480','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143244', '0', '2024-11-05 14:39:18', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '480', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:30:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','H1220', '143244', '14', '10380', '1', '480', '480', '0', '', '1', '2024-11-05 14:39:18', '10380', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        
                where sellbilldetailid = 523589;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10380, '2024-11-05', 480, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 14:39:18' WHERE storedetailid = '10379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10380', '1', '1', '1', '143244', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 14:39:18','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '24935',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('24455','480', '0', '1', 'اضافة فاتورة مبيعات', '143244', '24935', '2024-11-05 14:39:18', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 21 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 480, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 480, 360, 360
                    , 360, 360, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+480, netSellCostBuyPrice = netSellCostBuyPrice+360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+360
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+360
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+360
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0ff8a4e21 and sellbillId = 143244 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:09:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:39:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:39:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:10:11";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:40:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:40:11', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:10:50";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:40:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:40:50', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:10:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:40:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:40:59', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a11f72bb5b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:39:19', '0672a11f72bb5b', '1', '0.00', '0', '0', '1', '200.00', '200', '200', '0', '1', '2024-11-05 14:40:59', '', '9', '0', 'نقدي', '1', '0', '3', '5', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','200','0','','0','0','200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143245', '0', '2024-11-05 14:40:59', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '200', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:39:19','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34535;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06813', '143245', '5', '15496', '1', '200', '200', '0', '', '1', '2024-11-05 14:40:59', '15496', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34535-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523590;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-05 14:40:59' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '1', '143245', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-05 14:40:59','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '25135',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('24935','200', '0', '1', 'اضافة فاتورة مبيعات', '143245', '25135', '2024-11-05 14:40:59', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 5 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 200, 150, 150
                    , 150, 150, 150, 150, 150, 61)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+200, netSellCostBuyPrice = netSellCostBuyPrice+150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+150
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+150
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+150
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+150
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+150
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+150
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+61;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a11f72bb5b and sellbillId = 143245 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:11:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:41:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:41:00', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:12:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:42:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:42:04', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a125c85773
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:41:00', '0672a125c85773', '1', '0.00', '0', '0', '1', '1120.00', '1120', '1120', '0', '1', '2024-11-05 14:42:04', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','1120','0','','0','0','1120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143246', '0', '2024-11-05 14:42:04', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1120', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:41:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','H1408', '143246', '14', '15693', '1', '600', '600', '0', '', '1', '2024-11-05 14:42:04', '15693', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34605-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 523591;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15693, '2024-11-05', 600, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 600, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '9', storedetaildate = '2024-11-05 14:42:04' WHERE storedetailid = '15692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15693', '1', '1', '1', '143246', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '9', '2024-11-05 14:42:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34875;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1457', '143246', '14', '15841', '1', '520', '520', '0', '', '1', '2024-11-05 14:42:04', '15841', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34875-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523592;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15841, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-05 14:42:04' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '1', '1', '143246', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-05 14:42:04','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '26255',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('25135','1120', '0', '1', 'اضافة فاتورة مبيعات', '143246', '26255', '2024-11-05 14:42:04', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1120, 940, 940
                    , 940, 940, 940, 940
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,940, 940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1120, sellCostBuyPrice =sellCostBuyPrice+940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1120, 940, 940
                    , 940, 940, 940, 940
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,940, 940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1120, sellCostBuyPrice =sellCostBuyPrice+940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1120, 940, 940
                    , 940, 940, 940, 940, 940, 940)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1120, netSellCostBuyPrice = netSellCostBuyPrice+940
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+940
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+940
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+940
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+940
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+940
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+940
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+940;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a125c85773 and sellbillId = 143246 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:12:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:42:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:42:05', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:12:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:42:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:42:27', '2', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1252364ff
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(665,@clientdebt,@clientname,@treeIdis);
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 14:40:50', '0672a1252364ff', '665', '430.00', '30', '0', '1', '400', '400', '0', '-400', '1', '2024-11-05 14:42:27', '', '2', '0', 'رانيا راغب y48','2', '1', '5', '80', 'رانيا راغب y48', '1', '0', '', '','','','-1','0','0','0','','0','0','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '30', userid = '2' WHERE clientid = '665';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('665','430.00','400','1','اضافة فاتورة مردوات مبيعات','16228', '30', '2024-11-05 14:42:27', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '400', '0', null, '0', null, null,'', '0','1','1','400','1','2024-11-05 14:40:50','0','0');
UPDATE client SET  inUse = 0 where clientid = 665;
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('340.00', '06462', '16228', '5', '14768', '1', '400', '400', '0', '', '1', '0', '14768', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','400','400','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 928.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 928.00
        
                where returnsellbilldetailid = 21267;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14768, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 400, 340, 350, 928
                    , 350, 928, 346.67, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+400, returnSellCostBuyPrice = returnSellCostBuyPrice+340, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+350
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+928, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+350
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+928
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+346.67
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 400, 340, 350, 928
                    , 350, 928, 346.67, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+400, returnSellCostBuyPrice = returnSellCostBuyPrice+340, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+350
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+928, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+350
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+928
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+346.67
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 14:42:27' WHERE storedetailid = '14767';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14768', '1', '1', '0', '16228', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '5', '6', '2', '2024-11-05 14:42:27','0','0');
UPDATE client SET  delegateid = 80 where clientid = 665;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 400, 340, 350, 928
                    , 350, 928, 346.67 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+400, returnSellCostBuyPrice = returnSellCostBuyPrice+340, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+350
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+928, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+350
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+928
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+346.67
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (665, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 400, 340, 350, 928
                    , 350, 928, 346.67 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+400, returnSellCostBuyPrice = returnSellCostBuyPrice+340, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+350
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+928, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+350
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+928
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+346.67
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -400, -340, -350
                    , -928, -350, -928, -346.67, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-400, netSellCostBuyPrice = netSellCostBuyPrice+-340
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-928
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-928
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-346.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1252364ff and sellbillId = 16228 and returnsellbillId = 16228
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:12:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:42:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:42:28', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:13:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:43:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:43:23', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235823
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(939,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '5' , clientdate = '2024-11-05 14:43:23', userid = '2' WHERE clientid = '939';
UPDATE client SET  inUse = 0 where clientid = 939;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('939','1605.00','1600','1','ايصال تحصيل (( قبض من عميل ))','235823', '5', '2024-11-05 14:38:03', '2', 'clientPayedDeptController.php', '   ', '1600', '0', null, '0', null, null,'', '-1','1','1','1600','1','','777','0');
UPDATE save SET  savecurrentvalue = '174120.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('172520.50','1600', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235827', '174120.5', '2024-11-05 14:43:23', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('دينا يحيي u745', 'دينا يحيي u745', 'دينا يحيي u745', 'دينا يحيي u745', '58', '0', '5.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:43:23');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1600', '1600', '2024-11-05', '2', '0', '0', '2024-11-05 14:43:23','اضافة ايصال سداد للعميل دينا يحيي u745','1','0','0','0','235827','clientPayedDeptController.php?do=show&id=235827');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118926', '-1', '1600', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1600', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118926', '11194', '1600', '','0');
UPDATE accountstree SET name = 'دينا يحيي u745', customName = 'دينا يحيي u745', customNameEn = 'دينا يحيي u745', nameEn = 'دينا يحيي u745', parent = '58', accountNature = '0', theValue = '-1595', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:43:23' WHERE id = '11194';
UPDATE clientdebtchange SET clientid = '939', clientdebtchangebefore = '1605.000', clientdebtchangeamount = '1600.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235823', clientdebtchangeafter = '5.000', clientdebtchangedate = '2024-11-05 14:38:03', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1600.00',discount='', reciptid='0', dailyentryid = '118926',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1600',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235827';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235823 -clientdebtchangeId = 235827
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:13:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:43:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:43:24', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:13:48";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:43:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:43:48', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235828
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9958,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 14:43:49', userid = '2' WHERE clientid = '9958';
UPDATE client SET  inUse = 0 where clientid = 9958;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9958','768.00','768','1','ايصال تحصيل (( قبض من عميل ))','235828', '0', '2024-11-05 14:43:24', '2', 'clientPayedDeptController.php', '   ', '768', '0', null, '0', null, null,'', '-1','1','1','768','1','','778','0');
UPDATE save SET  savecurrentvalue = '174888.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('174120.50','768', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235828', '174888.5', '2024-11-05 14:43:49', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '768', '768', '2024-11-05', '2', '0', '0', '2024-11-05 14:43:49','اضافة ايصال سداد للعميل مريم هيبه 14','1','0','0','0','235828','clientPayedDeptController.php?do=show&id=235828');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118927', '-1', '768', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '768', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118927', '-1', '768', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-768', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9958', clientdebtchangebefore = '768.000', clientdebtchangeamount = '768.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235828', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 14:43:24', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '768.00',discount='', reciptid='0', dailyentryid = '118927',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='768',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235828';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235828 -clientdebtchangeId = 235828
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:13:50";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:43:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:43:50', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:13:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:43:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:43:53', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:14:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:44:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:44:06', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'رحمه', '', '30', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '26225',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('26255.00','30', '1', '1', 'إضافة مصروف', '24280', '26225', '2024-11-05 14:44:06', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'رحمه', expensesdetails = '', expensesValue = '30.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24280';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:14:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:44:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:44:07', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:14:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:44:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:44:08', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:14:15";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:44:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:44:15', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235829
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7245,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-1' , clientdate = '2024-11-05 14:44:15', userid = '2' WHERE clientid = '7245';
UPDATE client SET  inUse = 0 where clientid = 7245;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7245','714.00','715','1','ايصال تحصيل (( قبض من عميل ))','235829', '-1', '2024-11-05 14:43:50', '2', 'clientPayedDeptController.php', '   ', '715', '0', null, '0', null, null,'', '-1','1','1','715','1','','779','0');
UPDATE save SET  savecurrentvalue = '175603.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('174888.50','715', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235829', '175603.5', '2024-11-05 14:44:15', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('لميس حازم K128', 'لميس حازم K128', 'لميس حازم K128', 'لميس حازم K128', '58', '0', '-1.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:44:16');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '715', '715', '2024-11-05', '2', '0', '0', '2024-11-05 14:44:16','اضافة ايصال سداد للعميل لميس حازم K128','1','0','0','0','235829','clientPayedDeptController.php?do=show&id=235829');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118928', '-1', '715', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '715', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118928', '11195', '715', '','0');
UPDATE accountstree SET name = 'لميس حازم K128', customName = 'لميس حازم K128', customNameEn = 'لميس حازم K128', nameEn = 'لميس حازم K128', parent = '58', accountNature = '0', theValue = '-716', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:44:16' WHERE id = '11195';
UPDATE clientdebtchange SET clientid = '7245', clientdebtchangebefore = '714.000', clientdebtchangeamount = '715.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235829', clientdebtchangeafter = '-1.000', clientdebtchangedate = '2024-11-05 14:43:50', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '715.00',discount='', reciptid='0', dailyentryid = '118928',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='715',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235829';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235829 -clientdebtchangeId = 235829
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:14:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:44:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:44:17', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:14:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:44:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:44:40', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235830
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10275,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-2' , clientdate = '2024-11-05 14:44:40', userid = '2' WHERE clientid = '10275';
UPDATE client SET  inUse = 0 where clientid = 10275;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10275','1518.00','1520','1','ايصال تحصيل (( قبض من عميل ))','235830', '-2', '2024-11-05 14:44:17', '2', 'clientPayedDeptController.php', '   ', '1520', '0', null, '0', null, null,'', '-1','1','1','1520','1','','780','0');
UPDATE save SET  savecurrentvalue = '177123.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('175603.50','1520', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235830', '177123.5', '2024-11-05 14:44:40', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1520', '1520', '2024-11-05', '2', '0', '0', '2024-11-05 14:44:40','اضافة ايصال سداد للعميل تيا فاشون 52','1','0','0','0','235830','clientPayedDeptController.php?do=show&id=235830');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118929', '-1', '1520', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1520', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118929', '11159', '1520', '','0');
UPDATE accountstree SET name = 'تيا فاشون 52', customName = 'تيا فاشون 52', customNameEn = 'تيا فاشون 52', nameEn = 'تيا فاشون 52', parent = '58', accountNature = '0', theValue = '-2300', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-04 15:11:55' WHERE id = '11159';
UPDATE clientdebtchange SET clientid = '10275', clientdebtchangebefore = '1518.000', clientdebtchangeamount = '1520.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235830', clientdebtchangeafter = '-2.000', clientdebtchangedate = '2024-11-05 14:44:17', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1520.00',discount='', reciptid='0', dailyentryid = '118929',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1520',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235830';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235830 -clientdebtchangeId = 235830
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:14:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:44:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:44:40', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:15:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:45:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:45:04', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235831
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8163,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '40' , clientdate = '2024-11-05 14:45:04', userid = '2' WHERE clientid = '8163';
UPDATE client SET  inUse = 0 where clientid = 8163;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8163','298.00','258','1','ايصال تحصيل (( قبض من عميل ))','235831', '40', '2024-11-05 14:44:40', '2', 'clientPayedDeptController.php', '   ', '258', '0', null, '0', null, null,'', '-1','1','1','258','1','','781','0');
UPDATE save SET  savecurrentvalue = '177381.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('177123.50','258', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235831', '177381.5', '2024-11-05 14:45:04', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '258', '258', '2024-11-05', '2', '0', '0', '2024-11-05 14:45:04','اضافة ايصال سداد للعميل ماريه بسكالس T202','1','0','0','0','235831','clientPayedDeptController.php?do=show&id=235831');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118930', '-1', '258', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '258', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118930', '-1', '258', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-258', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '8163', clientdebtchangebefore = '298.000', clientdebtchangeamount = '258.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235831', clientdebtchangeafter = '40.000', clientdebtchangedate = '2024-11-05 14:44:40', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '258.00',discount='', reciptid='0', dailyentryid = '118930',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='258',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235831';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235831 -clientdebtchangeId = 235831
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:15:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:45:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:45:05', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:15:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:45:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:45:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a129d3d790
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:42:05', '0672a129d3d790', '1', '0.00', '0', '0', '1', '1310.00', '1310', '1310', '0', '1', '2024-11-05 14:45:08', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1310','0','','0','0','1310','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143247', '0', '2024-11-05 14:45:08', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1310', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:42:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34724;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','0K790', '143247', '7', '15758', '2', '240', '480', '0', '', '1', '2024-11-05 14:45:08', '15758', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34724-2,','1','1','0','0','240','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 95, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 523593;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15758, '2024-11-05', 480, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-05 14:45:08' WHERE storedetailid = '15757';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15758', '1', '2', '1', '143247', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '12', '9', '2024-11-05 14:45:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34803;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('465','06928', '143247', '5', '15802', '1', '520', '520', '0', '', '1', '2024-11-05 14:45:08', '15802', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34803-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 465.00, meanbuyprice_withDiscount = 465.00
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 465, lastbuyprice_withDiscountAndTax = 465
                where sellbilldetailid = 523594;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15802, '2024-11-05', 520, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 14:45:08' WHERE storedetailid = '15801';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15802', '1', '1', '1', '143247', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 14:45:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29487;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('365','05902', '143247', '5', '13166', '1', '310', '310', '0', '', '1', '2024-11-05 14:45:08', '13166', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29487-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 365.00
        
                where sellbilldetailid = 523595;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13166, '2024-11-05', 310, 365, 365
                    , 365, 365, 365, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 365, 365
                    , 365, 365, 365, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-05 14:45:08' WHERE storedetailid = '13165';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13166', '1', '1', '1', '143247', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-05 14:45:08','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '27535',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('26225','1310', '0', '1', 'اضافة فاتورة مبيعات', '143247', '27535', '2024-11-05 14:45:08', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1310, 1210, 1210
                    , 1210, 1210, 1210, 1210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,845, 655, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1310, sellCostBuyPrice =sellCostBuyPrice+1210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+845
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+655
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1310, 1210, 1210
                    , 1210, 1210, 1210, 1210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,845, 655, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1310, sellCostBuyPrice =sellCostBuyPrice+1210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+845
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+655
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1310, 1210, 1210
                    , 1210, 1210, 1210, 1210, 845, 655)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1310, netSellCostBuyPrice = netSellCostBuyPrice+1210
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1210
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1210
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1210
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1210
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1210
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+845
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+655;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a129d3d790 and sellbillId = 143247 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:15:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:45:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:45:09', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:15:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:45:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:45:33', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235832
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(493,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-05 14:45:33', userid = '2' WHERE clientid = '493';
UPDATE client SET  inUse = 0 where clientid = 493;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('493','606.00','586','1','ايصال تحصيل (( قبض من عميل ))','235832', '20', '2024-11-05 14:45:05', '2', 'clientPayedDeptController.php', '   ', '586', '0', null, '0', null, null,'', '-1','1','1','586','1','','782','0');
UPDATE save SET  savecurrentvalue = '177967.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('177381.50','586', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235833', '177967.5', '2024-11-05 14:45:33', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('رشا ورانيا f190', 'رشا ورانيا f190', 'رشا ورانيا f190', 'رشا ورانيا f190', '58', '0', '20.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:45:33');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '586', '586', '2024-11-05', '2', '0', '0', '2024-11-05 14:45:33','اضافة ايصال سداد للعميل رشا ورانيا f190','1','0','0','0','235833','clientPayedDeptController.php?do=show&id=235833');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118931', '-1', '586', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '586', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118931', '11196', '586', '','0');
UPDATE accountstree SET name = 'رشا ورانيا f190', customName = 'رشا ورانيا f190', customNameEn = 'رشا ورانيا f190', nameEn = 'رشا ورانيا f190', parent = '58', accountNature = '0', theValue = '-566', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:45:33' WHERE id = '11196';
UPDATE clientdebtchange SET clientid = '493', clientdebtchangebefore = '606.000', clientdebtchangeamount = '586.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235832', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-05 14:45:05', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '586.00',discount='', reciptid='0', dailyentryid = '118931',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='586',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235833';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235832 -clientdebtchangeId = 235833
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:15:34";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:45:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:45:34', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:16:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:46:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:46:01', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235834
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5202,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 14:46:01', userid = '2' WHERE clientid = '5202';
UPDATE client SET  inUse = 0 where clientid = 5202;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5202','3949.00','3949','1','ايصال تحصيل (( قبض من عميل ))','235834', '0', '2024-11-05 14:45:34', '2', 'clientPayedDeptController.php', '   ', '3949', '0', null, '0', null, null,'', '-1','1','1','3949','1','','783','0');
UPDATE save SET  savecurrentvalue = '181916.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('177967.50','3949', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235834', '181916.5', '2024-11-05 14:46:01', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3949', '3949', '2024-11-05', '2', '0', '0', '2024-11-05 14:46:02','اضافة ايصال سداد للعميل كرستينا المنصورة U4','1','0','0','0','235834','clientPayedDeptController.php?do=show&id=235834');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118932', '-1', '3949', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '3949', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118932', '-1', '3949', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-3949', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '5202', clientdebtchangebefore = '3949.000', clientdebtchangeamount = '3949.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235834', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 14:45:34', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '3949.00',discount='', reciptid='0', dailyentryid = '118932',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='3949',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235834';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235834 -clientdebtchangeId = 235834
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:16:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:46:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:46:02', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:16:34";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:46:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:46:34', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235835
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7020,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '28' , clientdate = '2024-11-05 14:46:34', userid = '2' WHERE clientid = '7020';
UPDATE client SET  inUse = 0 where clientid = 7020;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7020','348.00','320','1','ايصال تحصيل (( قبض من عميل ))','235835', '28', '2024-11-05 14:46:02', '2', 'clientPayedDeptController.php', '   ', '320', '0', null, '0', null, null,'', '-1','1','1','320','1','','784','0');
UPDATE save SET  savecurrentvalue = '1528620',  userid = '2' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1528300.00','320', '0', '3', 'ايصال تحصيل (( قبض من عميل ))', '235835', '1528620', '2024-11-05 14:46:34', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('شهد احمد F119', 'شهد احمد F119', 'شهد احمد F119', 'شهد احمد F119', '58', '0', '28.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:46:35');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '320', '320', '2024-11-05', '2', '0', '0', '2024-11-05 14:46:35','اضافة ايصال سداد للعميل شهد احمد F119','1','0','0','0','235835','clientPayedDeptController.php?do=show&id=235835');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118933', '-1', '320', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '320', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118933', '11197', '320', '','0');
UPDATE accountstree SET name = 'شهد احمد F119', customName = 'شهد احمد F119', customNameEn = 'شهد احمد F119', nameEn = 'شهد احمد F119', parent = '58', accountNature = '0', theValue = '-292', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:46:35' WHERE id = '11197';
UPDATE clientdebtchange SET clientid = '7020', clientdebtchangebefore = '348.000', clientdebtchangeamount = '320.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235835', clientdebtchangeafter = '28.000', clientdebtchangedate = '2024-11-05 14:46:02', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '320.00',discount='', reciptid='0', dailyentryid = '118933',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='320',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235835';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235835 -clientdebtchangeId = 235835
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:16:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:46:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:46:35', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:17:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:47:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:47:00', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:20:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:50:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:50:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a13c4c4969
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:47:00', '0672a13c4c4969', '1', '0.00', '0', '0', '1', '2970.00', '2970', '2970', '0', '1', '2024-11-05 14:50:08', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2970','0','','0','0','2970','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143248', '0', '2024-11-05 14:50:08', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2970', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:47:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34669;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','06901', '143248', '5', '15736', '1', '410', '410', '0', '', '1', '2024-11-05 14:50:08', '15736', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34669-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523596;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15736, '2024-11-05', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '31', userid = '9', storedetaildate = '2024-11-05 14:50:08' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '1', '1', '143248', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '31', '9', '2024-11-05 14:50:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34449;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3251', '143248', '1', '15589', '1', '350', '350', '0', '', '1', '2024-11-05 14:50:09', '15589', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34449-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523597;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15589, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '9', storedetaildate = '2024-11-05 14:50:09' WHERE storedetailid = '15588';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15589', '1', '1', '1', '143248', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '21', '9', '2024-11-05 14:50:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34544;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1402', '143248', '14', '15651', '1', '650', '650', '0', '', '1', '2024-11-05 14:50:09', '15651', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34544-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 575, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 523598;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15651, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 575, 575, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+575
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 575, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+575
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 14:50:09' WHERE storedetailid = '15650';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15651', '1', '1', '1', '143248', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 14:50:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34481;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('370','H1396', '143248', '14', '15616', '1', '470', '470', '0', '', '1', '2024-11-05 14:50:09', '15616', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34481-1,','1','1','0','0','470','470','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where sellbilldetailid = 523599;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15616, '2024-11-05', 470, 370, 370
                    , 370, 370, 370, 370
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 370, 370, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+370
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+370
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 470, 370, 370
                    , 370, 370, 370, 370
                    , 0, 0, 0, 0
                    , 0, 0, 0, 370, 370, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+370
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+370
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 14:50:09' WHERE storedetailid = '15615';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15616', '1', '1', '1', '143248', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 14:50:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34302;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('480','06805', '143248', '5', '15488', '1', '540', '540', '0', '', '1', '2024-11-05 14:50:09', '15488', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34302-1,','1','1','0','0','540','540','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 480.00
        
                where sellbilldetailid = 523600;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15488, '2024-11-05', 540, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 540, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-05 14:50:09' WHERE storedetailid = '15487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15488', '1', '1', '1', '143248', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-05 14:50:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34573;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1373', '143248', '14', '15533', '1', '550', '550', '0', '', '1', '2024-11-05 14:50:09', '15533', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34573-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 407, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523601;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15533, '2024-11-05', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-05 14:50:09' WHERE storedetailid = '15532';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15533', '1', '1', '1', '143248', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-05 14:50:09','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '30505',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('27535','2970', '0', '1', 'اضافة فاتورة مبيعات', '143248', '30505', '2024-11-05 14:50:09', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2970, 2520, 2520
                    , 2520, 2520, 2520, 2520
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2040, 1997, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1997
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 2970, 2520, 2520
                    , 2520, 2520, 2520, 2520
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2040, 1997, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1997
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2970, 2520, 2520
                    , 2520, 2520, 2520, 2520, 2040, 1997)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2970, netSellCostBuyPrice = netSellCostBuyPrice+2520
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2520
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2520
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2520
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2520
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2520
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2040
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1997;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a13c4c4969 and sellbillId = 143248 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:20:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:50:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:50:09', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:20:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:50:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:50:14', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:20:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:50:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:50:32', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235837
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1171,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 14:50:32', userid = '9' WHERE clientid = '1171';
UPDATE client SET  inUse = 0 where clientid = 1171;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1171','222.00','222','1','ايصال تحصيل (( قبض من عميل ))','235837', '0', '2024-11-05 14:50:14', '9', 'clientPayedDeptController.php', '   ', '222', '0', null, '0', null, null,'', '-1','1','1','222','1','','785','0');
UPDATE save SET  savecurrentvalue = '30727',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30505.00','222', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235837', '30727', '2024-11-05 14:50:32', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نرمين سويرس', 'نرمين سويرس', 'نرمين سويرس', 'نرمين سويرس', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '9', '0', '2024-11-05 14:50:32');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '222', '222', '2024-11-05', '9', '0', '0', '2024-11-05 14:50:32','اضافة ايصال سداد للعميل نرمين سويرس','1','0','0','0','235837','clientPayedDeptController.php?do=show&id=235837');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118934', '-1', '222', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '222', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118934', '11198', '222', '','0');
UPDATE accountstree SET name = 'نرمين سويرس', customName = 'نرمين سويرس', customNameEn = 'نرمين سويرس', nameEn = 'نرمين سويرس', parent = '58', accountNature = '0', theValue = '-222', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-11-05 14:50:32' WHERE id = '11198';
UPDATE clientdebtchange SET clientid = '1171', clientdebtchangebefore = '222.000', clientdebtchangeamount = '222.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235837', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 14:50:14', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '222.00',discount='', reciptid='0', dailyentryid = '118934',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='222',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235837';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235837 -clientdebtchangeId = 235837
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:20:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:50:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:50:33', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:20:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:50:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:50:34', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE userid = 2;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:20:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:50:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:50:46', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:20:53";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:50:53", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 14:50:53', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:21:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:51:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:51:01', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'نسبه وشحن', '', '22', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '30705',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30727.00','22', '1', '1', 'إضافة مصروف', '24281', '30705', '2024-11-05 14:51:02', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'نسبه وشحن', expensesdetails = '', expensesValue = '22.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24281';
COMMIT;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:21:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:51:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:51:02', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:21:03";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:51:03", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 14:51:03', '75', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:21:03";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:21:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:51:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 14:51:04', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:21:05";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:51:05", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 14:51:05', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:21:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:51:07", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:51:07', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:22:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:52:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:52:23', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:22:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:52:31", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:52:31', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a14bb24d3d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3095,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:51:07', '0672a14bb24d3d', '3095', '3891.00', '4351', '0', '1', '460.00', '460', '0', '460', '1', '2024-11-05 14:52:31', '', '75', '0', 'اسراء رزق K36', '2', '1', '3', '79', 'اسراء رزق K36', '2' ,'0','','','','','-1','0','0','0','0','0','460','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '4351', userid = '75' WHERE clientid = '3095';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3095','3891.00','460','0','اضافة فاتورة مبيعات','143249', '4351', '2024-11-05 14:52:31', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '460', '0', null, '0', null, null,'', '0','1','1','460','1','2024-11-05 14:51:07','0','0');
UPDATE client SET  inUse = 0 where clientid = 3095;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26995;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('390','05445', '143249', '5', '11868', '1', '455', '455', '0', '', '1', '2024-11-05 14:52:31', '11868', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26995-1,','1','1','0','0','455','455','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        
                where sellbilldetailid = 523602;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11868, '2024-11-05', 455, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 455, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 14:52:31' WHERE storedetailid = '11867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11868', '1', '1', '1', '143249', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 14:52:31','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143249', '17', '10291', '1', '5', '5', '0', '', '1', '2024-11-05 14:52:31', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','5','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 3095;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 460, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3095, '2024-11-05', 460, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 460, 390, 390
                    , 390, 390, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+460, netSellCostBuyPrice = netSellCostBuyPrice+390
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+390
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+390
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+390
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+390
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+390
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a14bb24d3d and sellbillId = 143249 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:22:32";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:52:32", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:52:32', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:22:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:52:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:52:49', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a15073b5a5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 14:52:23', '0672a15073b5a5', '1', '0.00', '0', '0', '1', '190', '190', '-190', '0', '1', '2024-11-05 14:52:49', '', '9', '0', 'نقدي','1', '0', '5', '97', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-190','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16229', '0', '2024-11-05 14:52:49', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '190', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:52:23','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('140.00', '06864', '16229', '5', '15647', '1', '190', '190', '0', '', '1', '0', '15647', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','190','190','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where returnsellbilldetailid = 21268;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15647, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 140
                    , 140, 140, 140, 0, 1, 0, 0, 140, 140)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+140, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+140
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+140
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+140
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+140
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 140
                    , 140, 140, 140, 0, 0, 140, 140)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+140, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+140
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+140
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+140
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+140;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 14:52:49' WHERE storedetailid = '15646';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15647', '1', '1', '0', '16229', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '12', '13', '9', '2024-11-05 14:52:49','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '30515',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30705','-190', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16229', '30515', '2024-11-05 14:52:49', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 140
                    , 140, 140, 140 ,0, 0, 140, 140)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+140, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+140
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+140
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+140
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+140;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 140
                    , 140, 140, 140 ,0, 0, 140, 140)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+140, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+140
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+140
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+140
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+140;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -190, -140, -140
                    , -140, -140, -140, -140, -140, -140)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-190, netSellCostBuyPrice = netSellCostBuyPrice+-140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-140
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-140
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-140
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-140;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a15073b5a5 and sellbillId = 16229 and returnsellbillId = 16229
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:22:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:52:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:52:50', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:23:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:53:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:53:11', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a13558750a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:45:09', '0672a13558750a', '1', '0.00', '0', '0', '1', '190.00', '190', '190', '0', '1', '2024-11-05 14:53:11', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','190','0','','0','0','190','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143250', '0', '2024-11-05 14:53:11', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '190', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:45:09','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34531;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06419', '143250', '5', '14600', '1', '190', '190', '0', '', '1', '2024-11-05 14:53:11', '14600', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34531-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523604;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14600, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140.83
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140.83
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 14:53:11' WHERE storedetailid = '14599';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14600', '1', '1', '1', '143250', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 14:53:11','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '30705',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30515','190', '0', '1', 'اضافة فاتورة مبيعات', '143250', '30705', '2024-11-05 14:53:11', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140.83
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140.83
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 190, 140, 140
                    , 140, 140, 140, 140.83, 140, 140)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+190, netSellCostBuyPrice = netSellCostBuyPrice+140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+140
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+140
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+140.83
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+140;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a13558750a and sellbillId = 143250 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:23:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:53:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:53:12', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:24:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:54:06", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:54:06', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a15109fb2b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1053,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:52:32', '0672a15109fb2b', '1053', '2303.00', '2828', '0', '1', '525.00', '525', '0', '525', '1', '2024-11-05 14:54:06', '', '75', '0', 'سيلفيا الاسماعيلية k230', '2', '1', '3', '79', 'سيلفيا الاسماعيلية k230', '2' ,'0','','','','','-1','0','0','0','0','0','525','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2828', userid = '75' WHERE clientid = '1053';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1053','2303.00','525','0','اضافة فاتورة مبيعات','143251', '2828', '2024-11-05 14:54:06', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '525', '0', null, '0', null, null,'', '0','1','1','525','1','2024-11-05 14:52:32','0','0');
UPDATE client SET  inUse = 0 where clientid = 1053;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34875;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1457', '143251', '14', '15841', '1', '520', '520', '0', '', '1', '2024-11-05 14:54:06', '15841', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34875-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523605;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15841, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '75', storedetaildate = '2024-11-05 14:54:06' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '1', '1', '143251', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '75', '2024-11-05 14:54:06','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143251', '17', '10291', '1', '5', '5', '0', '', '1', '2024-11-05 14:54:07', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','5','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 1053;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 525, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1053, '2024-11-05', 525, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 525, 410, 410
                    , 410, 410, 410, 410, 410, 410)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+525, netSellCostBuyPrice = netSellCostBuyPrice+410
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+410
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+410
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+410
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+410
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+410
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+410
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+410;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a15109fb2b and sellbillId = 143251 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:24:07";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:54:07", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:54:07', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:24:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:54:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:54:39', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a153871739
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(621,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:53:12', '0672a153871739', '621', '0.00', '313', '0', '1', '313.00', '313', '0', '313', '1', '2024-11-05 14:54:39', '', '9', '0', 'ام رودينا', '1', '1', '3', '97', 'ام رودينا', '2' ,'0','','','','','-1','0','0','0','0','0','313','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '313', userid = '9' WHERE clientid = '621';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('621','0.00','313','0','اضافة فاتورة مبيعات','143252', '313', '2024-11-05 14:54:39', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '313', '0', null, '0', null, null,'', '0','1','1','313','1','2024-11-05 14:53:12','0','0');
UPDATE client SET  inUse = 0 where clientid = 621;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34526;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06866', '143252', '5', '15640', '1', '310', '310', '0', '', '1', '2024-11-05 14:54:39', '15640', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34526-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523607;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15640, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '9', storedetaildate = '2024-11-05 14:54:39' WHERE storedetailid = '15639';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15640', '1', '1', '1', '143252', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '21', '9', '2024-11-05 14:54:39','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143252', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 14:54:39', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 97 where clientid = 621;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 313, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+313, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (621, '2024-11-05', 313, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+313, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 313, 250, 250
                    , 250, 250, 250, 250, 250, 250)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+313, netSellCostBuyPrice = netSellCostBuyPrice+250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+250
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+250
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+250
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+250
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+250;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a153871739 and sellbillId = 143252 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:24:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 14:54:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:54:39', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:24:49";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:54:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:54:49', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0f9e5c836
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8132,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:29:18', '0672a0f9e5c836', '8132', '0.00', '7343', '0', '1', '7343.00', '7343', '0', '7343', '1', '2024-11-05 14:54:49', '', '75', '0', 'رحمة طارق W6', '2', '1', '3', '83', 'رحمة طارق W6', '25' ,'0','','','','','-1','0','0','0','0','0','7343','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '7343', userid = '75' WHERE clientid = '8132';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8132','0.00','7343','0','اضافة فاتورة مبيعات','143253', '7343', '2024-11-05 14:54:49', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7343', '0', null, '0', null, null,'', '0','1','1','7343','1','2024-11-05 14:29:18','0','0');
UPDATE client SET  inUse = 0 where clientid = 8132;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 29822;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','05942', '143253', '5', '13255', '2', '395', '790', '0', '', '1', '2024-11-05 14:54:49', '13255', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29822-2,','1','1','0','0','395','790','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 442.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 442.00
        
                where sellbilldetailid = 523609;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13255, '2024-11-05', 790, 880, 880
                    , 884, 880, 884, 885
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+790, sellCostBuyPrice =sellCostBuyPrice+880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+884
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+884
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+885
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 790, 880, 880
                    , 884, 880, 884, 885
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+790, sellCostBuyPrice =sellCostBuyPrice+880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+884
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+884
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+885
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '13254';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13255', '1', '2', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '6', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30686;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','05889', '143253', '5', '13146', '1', '235', '235', '0', '', '1', '2024-11-05 14:54:49', '13146', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30686-1,','1','1','0','0','235','235','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523610;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13146, '2024-11-05', 235, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '13145';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13146', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 29605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','05936', '143253', '5', '13245', '2', '165', '330', '0', '', '1', '2024-11-05 14:54:49', '13245', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29605-2,','1','1','0','0','165','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 523611;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13245, '2024-11-05', 330, 750, 750
                    , 750, 750, 750, 750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 750, 750
                    , 750, 750, 750, 750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '13244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13245', '1', '2', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '3', '75', '2024-11-05 14:54:49','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','05890', '143253', '5', '13147', '1', '235', '235', '0', '', '1', '2024-11-05 14:54:49', '13147', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','235','235','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 408.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 408.00
        
                where sellbilldetailid = 523612;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13147, '2024-11-05', 235, 310, 320
                    , 408, 320, 408, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+408
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+408
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 310, 320
                    , 408, 320, 408, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+408
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+408
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '13146';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13147', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29585;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('455','05872', '143253', '5', '13115', '1', '385', '385', '0', '', '1', '2024-11-05 14:54:49', '13115', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29585-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 455.00 , meanbuyprice = 446.00, lastbuyprice_withDiscount = 455.00, meanbuyprice_withDiscount = 446.00
        
                where sellbilldetailid = 523613;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13115, '2024-11-05', 385, 445, 455
                    , 446, 455, 446, 443
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+443
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 445, 455
                    , 446, 455, 446, 443
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+443
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '13114';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13115', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32039;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','06353', '143253', '5', '14410', '1', '255', '255', '0', '', '1', '2024-11-05 14:54:49', '14410', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32039-1,','1','1','0','0','255','255','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523614;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14410, '2024-11-05', 255, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 255, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '14409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14410', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 32044;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('445','06350', '143253', '5', '14413', '3', '400', '1200', '0', '', '1', '2024-11-05 14:54:49', '14413', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32044-3,','1','1','0','0','400','1200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 2463.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 2463.00
        
                where sellbilldetailid = 523615;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14413, '2024-11-05', 1200, 1335, 1335
                    , 7389, 1335, 7389, 1335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7389
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7389
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1200, 1335, 1335
                    , 7389, 1335, 7389, 1335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7389
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7389
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '14412';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14413', '1', '3', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '1', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29514;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('445','05904', '143253', '5', '13171', '1', '420', '420', '0', '', '1', '2024-11-05 14:54:49', '13171', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29514-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 445.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 445.00
        
                where sellbilldetailid = 523616;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13171, '2024-11-05', 420, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '13170';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13171', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33035;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','06396', '143253', '5', '14543', '1', '285', '285', '0', '', '1', '2024-11-05 14:54:49', '14543', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33035-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 298.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 298.00
        
                where sellbilldetailid = 523617;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14543, '2024-11-05', 285, 300, 300
                    , 298, 300, 298, 297.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+298
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+298
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+297.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285, 300, 300
                    , 298, 300, 298, 297.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+298
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+298
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+297.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '14542';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14543', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 14:54:49','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','10361', '143253', '5', '10278', '3', '256.67', '770', '0', '', '1', '2024-11-05 14:54:49', '10278', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','256.67','770','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523618;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10278, '2024-11-05', 770, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+770, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 770, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+770, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-7', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '10277';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10278', '1', '3', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-4', '-7', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33986;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06340', '143253', '5', '14406', '1', '135', '135', '0', '', '1', '2024-11-05 14:54:49', '14406', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33986-1,','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        
                where sellbilldetailid = 523619;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14406, '2024-11-05', 135, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 135, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '14405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14406', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32254;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','06352', '143253', '5', '14488', '1', '325', '325', '0', '', '1', '2024-11-05 14:54:49', '14488', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32254-1,','1','1','0','0','325','325','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 523620;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14488, '2024-11-05', 325, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 325, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '14487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14488', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 31715;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06271', '143253', '5', '14260', '2', '440', '880', '0', '', '1', '2024-11-05 14:54:49', '14260', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31715-2,','1','1','0','0','440','880','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 561.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 561.00
        
                where sellbilldetailid = 523621;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14260, '2024-11-05', 880, 990, 990
                    , 1122, 990, 1122, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+880, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1122
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1122
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 880, 990, 990
                    , 1122, 990, 1122, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+880, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1122
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1122
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '14259';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14260', '1', '2', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '6', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26589;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05449', '143253', '5', '11864', '1', '420', '420', '0', '', '1', '2024-11-05 14:54:49', '11864', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26589-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 486.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 486.00
        
                where sellbilldetailid = 523622;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11864, '2024-11-05', 420, 495, 495
                    , 486, 495, 486, 486.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+486
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+486
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+486.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 495, 495
                    , 486, 495, 486, 486.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+486
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+486
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+486.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '11863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11864', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 14:54:49','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06307', '143253', '5', '14340', '1', '420', '420', '0', '', '1', '2024-11-05 14:54:49', '14340', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 71, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 523623;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14340, '2024-11-05', 420, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+71
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+71
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-8', userid = '75', storedetaildate = '2024-11-05 14:54:49' WHERE storedetailid = '14339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14340', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-7', '-8', '75', '2024-11-05 14:54:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32169;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06382', '143253', '5', '14477', '1', '165', '165', '0', '', '1', '2024-11-05 14:54:50', '14477', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32169-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 564.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 564.00
        
                where sellbilldetailid = 523624;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14477, '2024-11-05', 165, 175, 175
                    , 564, 175, 564, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+564
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+564
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 175, 175
                    , 564, 175, 564, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+564
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+564
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 14:54:50' WHERE storedetailid = '14476';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14477', '1', '1', '1', '143253', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 14:54:50','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143253', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 14:54:50', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143253', '17', '10291', '1', '73', '73', '0', '', '1', '2024-11-05 14:54:50', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','73','73','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 8132;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 7343, 8755, 8775
                    , 15422, 8775, 15422, 8751.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7343, sellCostBuyPrice =sellCostBuyPrice+8755
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15422
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15422
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8751.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+71
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8132, '2024-11-05', 7343, 8755, 8775
                    , 15422, 8775, 15422, 8751.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7343, sellCostBuyPrice =sellCostBuyPrice+8755
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15422
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15422
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8751.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+71
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 7343, 8755, 8775
                    , 15422, 8775, 15422, 8751.75, 495, 71)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7343, netSellCostBuyPrice = netSellCostBuyPrice+8755
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8775
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+15422
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8775
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+15422
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8751.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+495
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+71;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0f9e5c836 and sellbillId = 143253 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:24:50";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 14:54:50", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 14:54:50', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE userid = 75;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:25:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:55:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 14:55:08', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:25:08";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:25:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:55:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:55:14', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:26:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:56:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:56:22', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235844
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7674,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '3' , clientdate = '2024-11-05 14:56:22', userid = '2' WHERE clientid = '7674';
UPDATE client SET  inUse = 0 where clientid = 7674;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7674','505.00','502','1','ايصال تحصيل (( قبض من عميل ))','235844', '3', '2024-11-05 14:55:14', '2', 'clientPayedDeptController.php', '   ', '502', '0', null, '0', null, null,'', '-1','1','1','502','1','','786','0');
UPDATE save SET  savecurrentvalue = '182418.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('181916.50','502', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235844', '182418.5', '2024-11-05 14:56:22', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '502', '502', '2024-11-05', '2', '0', '0', '2024-11-05 14:56:23','اضافة ايصال سداد للعميل امنية اسعد الغردقة E500','1','0','0','0','235844','clientPayedDeptController.php?do=show&id=235844');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118935', '-1', '502', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '502', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118935', '-1', '502', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-502', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '7674', clientdebtchangebefore = '505.000', clientdebtchangeamount = '502.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235844', clientdebtchangeafter = '3.000', clientdebtchangedate = '2024-11-05 14:55:14', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '502.00',discount='', reciptid='0', dailyentryid = '118935',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='502',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235844';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235844 -clientdebtchangeId = 235844
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:26:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:56:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:56:23', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:28:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:58:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:58:35', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235845
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7055,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '22' , clientdate = '2024-11-05 14:58:35', userid = '2' WHERE clientid = '7055';
UPDATE client SET  inUse = 0 where clientid = 7055;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7055','1652.00','1630','1','ايصال تحصيل (( قبض من عميل ))','235845', '22', '2024-11-05 14:56:23', '2', 'clientPayedDeptController.php', '   ', '1630', '0', null, '0', null, null,'', '-1','1','1','1630','1','','787','0');
UPDATE save SET  savecurrentvalue = '184048.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('182418.50','1630', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235845', '184048.5', '2024-11-05 14:58:35', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مصطفي ابراهيم U43', 'مصطفي ابراهيم U43', 'مصطفي ابراهيم U43', 'مصطفي ابراهيم U43', '58', '0', '22.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:58:35');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1630', '1630', '2024-11-05', '2', '0', '0', '2024-11-05 14:58:35','اضافة ايصال سداد للعميل مصطفي ابراهيم U43','1','0','0','0','235845','clientPayedDeptController.php?do=show&id=235845');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118936', '-1', '1630', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1630', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118936', '11199', '1630', '','0');
UPDATE accountstree SET name = 'مصطفي ابراهيم U43', customName = 'مصطفي ابراهيم U43', customNameEn = 'مصطفي ابراهيم U43', nameEn = 'مصطفي ابراهيم U43', parent = '58', accountNature = '0', theValue = '-1608', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:58:35' WHERE id = '11199';
UPDATE clientdebtchange SET clientid = '7055', clientdebtchangebefore = '1652.000', clientdebtchangeamount = '1630.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235845', clientdebtchangeafter = '22.000', clientdebtchangedate = '2024-11-05 14:56:23', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1630.00',discount='', reciptid='0', dailyentryid = '118936',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1630',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235845';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235845 -clientdebtchangeId = 235845
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:28:36";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:58:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:58:36', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:28:45";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 14:58:45", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 14:58:45', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:29:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:59:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:59:21', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235846
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(161,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-4' , clientdate = '2024-11-05 14:59:21', userid = '2' WHERE clientid = '161';
UPDATE client SET  inUse = 0 where clientid = 161;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('161','369.00','373','1','ايصال تحصيل (( قبض من عميل ))','235846', '-4', '2024-11-05 14:58:36', '2', 'clientPayedDeptController.php', '   ', '373', '0', null, '0', null, null,'', '-1','1','1','373','1','','788','0');
UPDATE save SET  savecurrentvalue = '184421.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('184048.50','373', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235846', '184421.5', '2024-11-05 14:59:21', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ميرنا محسن', 'ميرنا محسن', 'ميرنا محسن', 'ميرنا محسن', '58', '0', '-4.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 14:59:21');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '373', '373', '2024-11-05', '2', '0', '0', '2024-11-05 14:59:21','اضافة ايصال سداد للعميل ميرنا محسن','1','0','0','0','235846','clientPayedDeptController.php?do=show&id=235846');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118937', '-1', '373', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '373', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118937', '11200', '373', '','0');
UPDATE accountstree SET name = 'ميرنا محسن', customName = 'ميرنا محسن', customNameEn = 'ميرنا محسن', nameEn = 'ميرنا محسن', parent = '58', accountNature = '0', theValue = '-377', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:59:21' WHERE id = '11200';
UPDATE clientdebtchange SET clientid = '161', clientdebtchangebefore = '369.000', clientdebtchangeamount = '373.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235846', clientdebtchangeafter = '-4.000', clientdebtchangedate = '2024-11-05 14:58:36', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '373.00',discount='', reciptid='0', dailyentryid = '118937',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='373',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235846';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235846 -clientdebtchangeId = 235846
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:29:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 14:59:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 14:59:22', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:30:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:00:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:00:02', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235847
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1551,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 15:00:02', userid = '2' WHERE clientid = '1551';
UPDATE client SET  inUse = 0 where clientid = 1551;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1551','303.00','303','1','ايصال تحصيل (( قبض من عميل ))','235847', '0', '2024-11-05 14:59:22', '2', 'clientPayedDeptController.php', '   ', '303', '0', null, '0', null, null,'', '-1','1','1','303','1','','789','0');
UPDATE save SET  savecurrentvalue = '184724.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('184421.50','303', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235847', '184724.5', '2024-11-05 15:00:02', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '303', '303', '2024-11-05', '2', '0', '0', '2024-11-05 15:00:02','اضافة ايصال سداد للعميل ام ملك الاسماعلية d1','1','0','0','0','235847','clientPayedDeptController.php?do=show&id=235847');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118938', '-1', '303', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '303', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118938', '-1', '303', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-303', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '1551', clientdebtchangebefore = '303.000', clientdebtchangeamount = '303.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235847', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 14:59:22', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '303.00',discount='', reciptid='0', dailyentryid = '118938',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='303',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235847';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235847 -clientdebtchangeId = 235847
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:30:03";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:00:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:00:03', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:32:50";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 15:02:50", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 15:02:50', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:32:59";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 15:02:59", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 15:02:59', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:33:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:03:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:03:40', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a15901cf50
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:54:40', '0672a15901cf50', '1', '0.00', '0', '0', '1', '775.00', '775', '775', '0', '1', '2024-11-05 15:03:40', '', '9', '0', 'نقدي', '1', '0', '3', '99', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','775','0','','0','0','775','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143254', '0', '2024-11-05 15:03:40', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '775', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 14:54:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34710;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06903', '143254', '5', '15753', '1', '320', '320', '0', '', '1', '2024-11-05 15:03:40', '15753', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34710-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523627;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15753, '2024-11-05', 320, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 15:03:40' WHERE storedetailid = '15752';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15753', '1', '1', '1', '143254', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 15:03:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34376;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','06828', '143254', '5', '15544', '1', '235', '235', '0', '', '1', '2024-11-05 15:03:40', '15544', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34376-1,','1','1','0','0','235','235','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        
                where sellbilldetailid = 523628;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15544, '2024-11-05', 235, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 15:03:40' WHERE storedetailid = '15543';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15544', '1', '1', '1', '143254', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-05 15:03:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20680;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0K403', '143254', '7', '9519', '1', '220', '220', '0', '', '1', '2024-11-05 15:03:40', '9519', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20680-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where sellbilldetailid = 523629;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9519, '2024-11-05', 220, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-18', userid = '9', storedetaildate = '2024-11-05 15:03:40' WHERE storedetailid = '9518';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9519', '1', '1', '1', '143254', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-17', '-18', '9', '2024-11-05 15:03:40','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '31480',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30705','775', '0', '1', 'اضافة فاتورة مبيعات', '143254', '31480', '2024-11-05 15:03:40', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 99 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 775, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+775, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 775, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+775, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 775, 660, 660
                    , 660, 660, 660, 660, 260, 260)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+775, netSellCostBuyPrice = netSellCostBuyPrice+660
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+660
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+660
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+660
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+660
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+660
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+260;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a15901cf50 and sellbillId = 143254 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:33:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:03:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:03:41', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:35:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:05:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:05:15', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:35:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:05:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:05:18', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:37:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:07:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:07:26', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a180eaef6c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 15:05:18', '0672a180eaef6c', '1', '0.00', '0', '0', '1', '510', '510', '-510', '0', '1', '2024-11-05 15:07:26', '', '9', '0', 'نقدي','1', '0', '5', '6', 'نقدي', '2', '0', '', '','','','-1','0','0','0','','0','-510','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16230', '0', '2024-11-05 15:07:26', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '510', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:05:18','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('250.00', '06149', '16230', '5', '13916', '1', '230', '230', '0', '', '1', '0', '13916', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','230','230','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where returnsellbilldetailid = 21269;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13916, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 230, 250, 250, 250
                    , 250, 250, 250, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+230, returnSellCostBuyPrice = returnSellCostBuyPrice+250, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+250
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+250, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+250
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+250
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+250
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 230, 250, 250, 250
                    , 250, 250, 250, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+230, returnSellCostBuyPrice = returnSellCostBuyPrice+250, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+250
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+250, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+250
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+250
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+250
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 15:07:26' WHERE storedetailid = '13915';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13916', '1', '1', '0', '16230', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '5', '6', '9', '2024-11-05 15:07:26','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('230.00', 'R3146', '16230', '1', '15175', '1', '280', '280', '0', '', '1', '0', '15175', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','280','280','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        
                where returnsellbilldetailid = 21270;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15175, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 280, 230, 230, 230
                    , 230, 230, 230, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+280, returnSellCostBuyPrice = returnSellCostBuyPrice+230, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+230
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+230, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+230
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+230
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+230
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 280, 230, 230, 230
                    , 230, 230, 230, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+280, returnSellCostBuyPrice = returnSellCostBuyPrice+230, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+230
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+230, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+230
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+230
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+230
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 15:07:26' WHERE storedetailid = '15174';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15175', '1', '1', '0', '16230', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '3', '4', '9', '2024-11-05 15:07:26','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '30970',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31480','-510', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16230', '30970', '2024-11-05 15:07:26', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 510, 480, 480, 480
                    , 480, 480, 480 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+510, returnSellCostBuyPrice = returnSellCostBuyPrice+480, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+480
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+480, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+480
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+480
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+480
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 510, 480, 480, 480
                    , 480, 480, 480 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+510, returnSellCostBuyPrice = returnSellCostBuyPrice+480, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+480
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+480, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+480
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+480
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+480
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -510, -480, -480
                    , -480, -480, -480, -480, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-510, netSellCostBuyPrice = netSellCostBuyPrice+-480
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-480
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-480
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-480
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-480
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-480
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a180eaef6c and sellbillId = 16230 and returnsellbillId = 16230
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:37:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:07:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:07:26', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:39:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:09:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:09:08', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235848
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7005,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '450' , clientdate = '2024-11-05 15:09:08', userid = '2' WHERE clientid = '7005';
UPDATE client SET  inUse = 0 where clientid = 7005;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7005','1510.00','1060','1','ايصال تحصيل (( قبض من عميل ))','235848', '450', '2024-11-05 15:00:03', '2', 'clientPayedDeptController.php', '   ', '1060', '0', null, '0', null, null,'', '-1','1','1','1060','1','','790','0');
UPDATE save SET  savecurrentvalue = '185784.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('184724.50','1060', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235850', '185784.5', '2024-11-05 15:09:08', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مي يوسف W10', 'مي يوسف W10', 'مي يوسف W10', 'مي يوسف W10', '58', '0', '450.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 15:09:08');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1060', '1060', '2024-11-05', '2', '0', '0', '2024-11-05 15:09:08','اضافة ايصال سداد للعميل مي يوسف W10','1','0','0','0','235850','clientPayedDeptController.php?do=show&id=235850');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118939', '-1', '1060', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1060', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118939', '11201', '1060', '','0');
UPDATE accountstree SET name = 'مي يوسف W10', customName = 'مي يوسف W10', customNameEn = 'مي يوسف W10', nameEn = 'مي يوسف W10', parent = '58', accountNature = '0', theValue = '-610', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 15:09:08' WHERE id = '11201';
UPDATE clientdebtchange SET clientid = '7005', clientdebtchangebefore = '1510.000', clientdebtchangeamount = '1060.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235848', clientdebtchangeafter = '450.000', clientdebtchangedate = '2024-11-05 15:00:03', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1060.00',discount='', reciptid='0', dailyentryid = '118939',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1060',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235850';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235848 -clientdebtchangeId = 235850
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:39:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:09:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:09:09', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:39:52";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:09:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:09:52', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235851
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9961,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1' , clientdate = '2024-11-05 15:09:52', userid = '2' WHERE clientid = '9961';
UPDATE client SET  inUse = 0 where clientid = 9961;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9961','324.00','323','1','ايصال تحصيل (( قبض من عميل ))','235851', '1', '2024-11-05 15:09:09', '2', 'clientPayedDeptController.php', '   ', '323', '0', null, '0', null, null,'', '-1','1','1','323','1','','791','0');
UPDATE save SET  savecurrentvalue = '186107.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('185784.50','323', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235851', '186107.5', '2024-11-05 15:09:52', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '323', '323', '2024-11-05', '2', '0', '0', '2024-11-05 15:09:52','اضافة ايصال سداد للعميل سارة رجب حسن 12','1','0','0','0','235851','clientPayedDeptController.php?do=show&id=235851');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118940', '-1', '323', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '323', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118940', '-1', '323', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-323', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9961', clientdebtchangebefore = '324.000', clientdebtchangeamount = '323.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235851', clientdebtchangeafter = '1.000', clientdebtchangedate = '2024-11-05 15:09:09', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '323.00',discount='', reciptid='0', dailyentryid = '118940',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='323',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235851';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235851 -clientdebtchangeId = 235851
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:39:53";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:09:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:09:53', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:40:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:10:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:10:39', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235852
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6747,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '14' , clientdate = '2024-11-05 15:10:39', userid = '2' WHERE clientid = '6747';
UPDATE client SET  inUse = 0 where clientid = 6747;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6747','814.00','800','1','ايصال تحصيل (( قبض من عميل ))','235852', '14', '2024-11-05 15:09:53', '2', 'clientPayedDeptController.php', '   ', '800', '0', null, '0', null, null,'', '-1','1','1','800','1','','792','0');
UPDATE save SET  savecurrentvalue = '186907.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('186107.50','800', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235852', '186907.5', '2024-11-05 15:10:39', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('وسام احمد X44', 'وسام احمد X44', 'وسام احمد X44', 'وسام احمد X44', '58', '0', '14.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 15:10:39');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '800', '800', '2024-11-05', '2', '0', '0', '2024-11-05 15:10:39','اضافة ايصال سداد للعميل وسام احمد X44','1','0','0','0','235852','clientPayedDeptController.php?do=show&id=235852');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118941', '-1', '800', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '800', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118941', '11202', '800', '','0');
UPDATE accountstree SET name = 'وسام احمد X44', customName = 'وسام احمد X44', customNameEn = 'وسام احمد X44', nameEn = 'وسام احمد X44', parent = '58', accountNature = '0', theValue = '-786', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 15:10:39' WHERE id = '11202';
UPDATE clientdebtchange SET clientid = '6747', clientdebtchangebefore = '814.000', clientdebtchangeamount = '800.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235852', clientdebtchangeafter = '14.000', clientdebtchangedate = '2024-11-05 15:09:53', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '800.00',discount='', reciptid='0', dailyentryid = '118941',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='800',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235852';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235852 -clientdebtchangeId = 235852
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:40:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:10:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:10:40', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:40:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:10:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:10:51', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:41:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:11:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:11:21', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235853
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(539,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 15:11:21', userid = '2' WHERE clientid = '539';
UPDATE client SET  inUse = 0 where clientid = 539;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('539','313.00','313','1','ايصال تحصيل (( قبض من عميل ))','235853', '0', '2024-11-05 15:10:40', '2', 'clientPayedDeptController.php', '   ', '313', '0', null, '0', null, null,'', '-1','1','1','313','1','','793','0');
UPDATE save SET  savecurrentvalue = '187220.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('186907.50','313', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235853', '187220.5', '2024-11-05 15:11:21', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('عزة محمود T71', 'عزة محمود T71', 'عزة محمود T71', 'عزة محمود T71', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 15:11:21');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '313', '313', '2024-11-05', '2', '0', '0', '2024-11-05 15:11:21','اضافة ايصال سداد للعميل عزة محمود T71','1','0','0','0','235853','clientPayedDeptController.php?do=show&id=235853');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118942', '-1', '313', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '313', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118942', '11203', '313', '','0');
UPDATE accountstree SET name = 'عزة محمود T71', customName = 'عزة محمود T71', customNameEn = 'عزة محمود T71', nameEn = 'عزة محمود T71', parent = '58', accountNature = '0', theValue = '-313', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 15:11:21' WHERE id = '11203';
UPDATE clientdebtchange SET clientid = '539', clientdebtchangebefore = '313.000', clientdebtchangeamount = '313.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235853', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 15:10:40', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '313.00',discount='', reciptid='0', dailyentryid = '118942',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='313',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235853';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235853 -clientdebtchangeId = 235853
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:41:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:11:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:11:22', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:42:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:12:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:12:33', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:42:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:12:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:12:45', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:42:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:12:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:12:52', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '30', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '30940',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30970.00','30', '1', '1', 'إضافة مصروف', '24282', '30940', '2024-11-05 15:12:52', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '30.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24282';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:42:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:12:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:12:52', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:42:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:12:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:12:54', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:43:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:13:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:13:39', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a195b7bf59
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:10:51', '0672a195b7bf59', '1', '0.00', '0', '0', '1', '480.00', '480', '480', '0', '1', '2024-11-05 15:13:40', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','480','0','','0','0','480','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143255', '0', '2024-11-05 15:13:40', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '480', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:10:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34450;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3174', '143255', '1', '15319', '1', '330', '330', '0', '', '1', '2024-11-05 15:13:40', '15319', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34450-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 178, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523630;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15319, '2024-11-05', 330, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 15:13:40' WHERE storedetailid = '15318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15319', '1', '1', '1', '143255', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 15:13:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29358;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R2676', '143255', '1', '13112', '1', '150', '150', '0', '', '1', '2024-11-05 15:13:40', '13112', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29358-1,','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 523631;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13112, '2024-11-05', 150, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 15:13:40' WHERE storedetailid = '13111';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13112', '1', '1', '1', '143255', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '9', '2024-11-05 15:13:40','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '31420',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30940','480', '0', '1', 'اضافة فاتورة مبيعات', '143255', '31420', '2024-11-05 15:13:40', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 480, 535, 535
                    , 535, 535, 535, 533.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+535, sellCostMeanBuyPrice = sellCostMeanBuyPrice+535
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+535
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+533.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 535, 535
                    , 535, 535, 535, 533.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+535
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+535, sellCostMeanBuyPrice = sellCostMeanBuyPrice+535
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+535, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+535
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+533.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 480, 535, 535
                    , 535, 535, 535, 533.75, 285, 178)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+480, netSellCostBuyPrice = netSellCostBuyPrice+535
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+535
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+535
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+535
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+535
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+533.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+178;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a195b7bf59 and sellbillId = 143255 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:43:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:13:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:13:40', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:43:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:13:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 15:13:40', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:43:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:13:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:13:45', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:43:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:13:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:13:46', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:43:51";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:13:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 15:13:51', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:43:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:13:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:13:59', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ابو شامه', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '31370',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31420.00','50', '1', '1', 'إضافة مصروف', '24283', '31370', '2024-11-05 15:13:59', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ابو شامه', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24283';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:43:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:13:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:13:59', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:44:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:14:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:14:01', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:44:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:14:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:14:31', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:45:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:15:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:15:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('مارو 41' , '', '', '01221315270', '0', '', '0', '2024-11-05 15:16:51', '2', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10281', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10281','0','0','0','إضافة عميل جديد','10281', '0', '2024-11-05 15:16:51', '2', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مارو 41', 'مارو 41', 'مارو 41', 'مارو 41', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 15:16:51');
UPDATE client SET clientname = 'مارو 41', clientaddress = '', clientphone = '', clientmobile = '01221315270', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11204',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10281';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:17:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:17:00', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1a3761161
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:14:31', '0672a1a3761161', '1', '0.00', '0', '0', '1', '955.00', '955', '955', '0', '1', '2024-11-05 15:17:00', '', '9', '0', 'نقدي', '1', '0', '3', '94', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','955','0','','0','0','955','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143256', '0', '2024-11-05 15:17:00', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '955', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:14:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32254;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','06352', '143256', '5', '14488', '2', '325', '650', '0', '', '1', '2024-11-05 15:17:00', '14488', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32254-1,','1','1','0','0','325','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 523632;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14488, '2024-11-05', 650, 680, 680
                    , 680, 680, 680, 680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 680, 680
                    , 680, 680, 680, 680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 15:17:00' WHERE storedetailid = '14487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14488', '1', '2', '1', '143256', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '1', '9', '2024-11-05 15:17:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32195;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','06375', '143256', '5', '14493', '1', '305', '305', '0', '', '1', '2024-11-05 15:17:00', '14493', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32195-1,','1','1','0','0','305','305','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523633;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14493, '2024-11-05', 305, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+305, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 305, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+305, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 15:17:00' WHERE storedetailid = '14492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14493', '1', '1', '1', '143256', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 15:17:00','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '32325',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('31370','955', '0', '1', 'اضافة فاتورة مبيعات', '143256', '32325', '2024-11-05 15:17:00', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 94 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 955, 1010, 1010
                    , 1010, 1010, 1010, 1010
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+955, sellCostBuyPrice =sellCostBuyPrice+1010
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1010
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1010, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1010
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1010
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 955, 1010, 1010
                    , 1010, 1010, 1010, 1010
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+955, sellCostBuyPrice =sellCostBuyPrice+1010
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1010
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1010, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1010
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1010
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 955, 1010, 1010
                    , 1010, 1010, 1010, 1010, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+955, netSellCostBuyPrice = netSellCostBuyPrice+1010
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1010
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1010
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1010
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1010
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1010
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1a3761161 and sellbillId = 143256 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:17:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:17:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:17:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:17:08', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:17:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:17:25', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235857
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10281,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-100' , clientdate = '2024-11-05 15:17:25', userid = '2' WHERE clientid = '10281';
UPDATE client SET  inUse = 0 where clientid = 10281;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10281','0.00','100','1','ايصال تحصيل (( قبض من عميل ))','235857', '-100', '2024-11-05 15:17:08', '2', 'clientPayedDeptController.php', '   ', '100', '0', null, '0', null, null,'', '-1','1','1','100','1','','794','0');
UPDATE save SET  savecurrentvalue = '187320.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('187220.50','100', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235857', '187320.5', '2024-11-05 15:17:25', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '100', '100', '2024-11-05', '2', '0', '0', '2024-11-05 15:17:26','اضافة ايصال سداد للعميل مارو 41','1','0','0','0','235857','clientPayedDeptController.php?do=show&id=235857');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118943', '-1', '100', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '100', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118943', '11204', '100', '','0');
UPDATE accountstree SET name = 'مارو 41', customName = 'مارو 41', customNameEn = 'مارو 41', nameEn = 'مارو 41', parent = '58', accountNature = '0', theValue = '-100', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 15:16:51' WHERE id = '11204';
UPDATE clientdebtchange SET clientid = '10281', clientdebtchangebefore = '0.000', clientdebtchangeamount = '100.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235857', clientdebtchangeafter = '-100.000', clientdebtchangedate = '2024-11-05 15:17:08', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '100.00',discount='', reciptid='0', dailyentryid = '118943',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='100',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235857';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235857 -clientdebtchangeId = 235857
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:26";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:17:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:17:26', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:17:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:17:39', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1a7fe9fec
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:15:43', '0672a1a7fe9fec', '1', '0.00', '0', '0', '1', '555.00', '555', '555', '0', '1', '2024-11-05 15:17:39', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','555','0','','0','0','555','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143257', '0', '2024-11-05 15:17:39', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '555', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:15:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34726;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('215','0K789', '143257', '7', '15760', '1', '275', '275', '0', '', '1', '2024-11-05 15:17:39', '15760', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34726-1,','1','1','0','0','275','275','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 215.00 , meanbuyprice = 215.00, lastbuyprice_withDiscount = 215.00, meanbuyprice_withDiscount = 215.00
        , lastbuyprice_withTax = 215, meanbuyprice_withTax = 215, lastbuyprice_withDiscountAndTax = 215
                where sellbilldetailid = 523634;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15760, '2024-11-05', 275, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 275, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-05 15:17:39' WHERE storedetailid = '15759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15760', '1', '1', '1', '143257', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-05 15:17:39','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34858;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','0K793', '143257', '7', '15834', '1', '280', '280', '0', '', '1', '2024-11-05 15:17:39', '15834', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34858-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523635;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15834, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '9', storedetaildate = '2024-11-05 15:17:39' WHERE storedetailid = '15833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15834', '1', '1', '1', '143257', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '9', '2024-11-05 15:17:39','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '32880',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32325','555', '0', '1', 'اضافة فاتورة مبيعات', '143257', '32880', '2024-11-05 15:17:39', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 555, 435, 435
                    , 435, 435, 435, 435
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,435, 435, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+555, sellCostBuyPrice =sellCostBuyPrice+435
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+435, sellCostMeanBuyPrice = sellCostMeanBuyPrice+435
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+435, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+435
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+435
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+435
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+435
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 555, 435, 435
                    , 435, 435, 435, 435
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,435, 435, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+555, sellCostBuyPrice =sellCostBuyPrice+435
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+435, sellCostMeanBuyPrice = sellCostMeanBuyPrice+435
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+435, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+435
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+435
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+435
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+435
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 555, 435, 435
                    , 435, 435, 435, 435, 435, 435)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+555, netSellCostBuyPrice = netSellCostBuyPrice+435
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+435
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+435
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+435
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+435
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+435
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+435
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+435;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1a7fe9fec and sellbillId = 143257 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:17:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:17:39', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:48";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:17:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:17:48', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235858
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(564,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-1000' , clientdate = '2024-11-05 15:17:48', userid = '2' WHERE clientid = '564';
UPDATE client SET  inUse = 0 where clientid = 564;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('564','0.00','1000','1','ايصال تحصيل (( قبض من عميل ))','235858', '-1000', '2024-11-05 15:17:26', '2', 'clientPayedDeptController.php', '   ', '1000', '0', null, '0', null, null,'', '-1','1','1','1000','1','','795','0');
UPDATE save SET  savecurrentvalue = '188320.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('187320.50','1000', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235859', '188320.5', '2024-11-05 15:17:48', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نشوي عبد الهادي x104', 'نشوي عبد الهادي x104', 'نشوي عبد الهادي x104', 'نشوي عبد الهادي x104', '58', '0', '-1000.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 15:17:49');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1000', '1000', '2024-11-05', '2', '0', '0', '2024-11-05 15:17:49','اضافة ايصال سداد للعميل نشوي عبد الهادي x104','1','0','0','0','235859','clientPayedDeptController.php?do=show&id=235859');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118944', '-1', '1000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118944', '11205', '1000', '','0');
UPDATE accountstree SET name = 'نشوي عبد الهادي x104', customName = 'نشوي عبد الهادي x104', customNameEn = 'نشوي عبد الهادي x104', nameEn = 'نشوي عبد الهادي x104', parent = '58', accountNature = '0', theValue = '-2000', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 15:17:49' WHERE id = '11205';
UPDATE clientdebtchange SET clientid = '564', clientdebtchangebefore = '0.000', clientdebtchangeamount = '1000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235858', clientdebtchangeafter = '-1000.000', clientdebtchangedate = '2024-11-05 15:17:26', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1000.00',discount='', reciptid='0', dailyentryid = '118944',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1000',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235859';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235858 -clientdebtchangeId = 235859
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:47:49";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:17:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:17:49', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:48:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:18:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:18:14', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235860
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9690,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1218' , clientdate = '2024-11-05 15:18:14', userid = '2' WHERE clientid = '9690';
UPDATE client SET  inUse = 0 where clientid = 9690;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9690','1788.00','570','1','ايصال تحصيل (( قبض من عميل ))','235860', '1218', '2024-11-05 15:17:49', '2', 'clientPayedDeptController.php', '   ', '570', '0', null, '0', null, null,'', '-1','1','1','570','1','','796','0');
UPDATE save SET  savecurrentvalue = '188890.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('188320.50','570', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235860', '188890.5', '2024-11-05 15:18:14', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '570', '570', '2024-11-05', '2', '0', '0', '2024-11-05 15:18:15','اضافة ايصال سداد للعميل اسماء فوزي12','1','0','0','0','235860','clientPayedDeptController.php?do=show&id=235860');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118945', '-1', '570', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '570', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118945', '-1', '570', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-570', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9690', clientdebtchangebefore = '1788.000', clientdebtchangeamount = '570.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235860', clientdebtchangeafter = '1218.000', clientdebtchangedate = '2024-11-05 15:17:49', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '570.00',discount='', reciptid='0', dailyentryid = '118945',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='570',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235860';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235860 -clientdebtchangeId = 235860
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:48:15";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:18:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:18:15', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:48:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:18:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:18:40', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235861
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9690,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '218' , clientdate = '2024-11-05 15:18:40', userid = '2' WHERE clientid = '9690';
UPDATE client SET  inUse = 0 where clientid = 9690;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9690','1218.00','1000','1','ايصال تحصيل (( قبض من عميل ))','235861', '218', '2024-11-05 15:18:16', '2', 'clientPayedDeptController.php', '   ', '1000', '0', null, '0', null, null,'', '-1','1','1','1000','1','','797','0');
UPDATE save SET  savecurrentvalue = '189890.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('188890.50','1000', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235861', '189890.5', '2024-11-05 15:18:40', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1000', '1000', '2024-11-05', '2', '0', '0', '2024-11-05 15:18:41','اضافة ايصال سداد للعميل اسماء فوزي12','1','0','0','0','235861','clientPayedDeptController.php?do=show&id=235861');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118946', '-1', '1000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118946', '-1', '1000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9690', clientdebtchangebefore = '1218.000', clientdebtchangeamount = '1000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235861', clientdebtchangeafter = '218.000', clientdebtchangedate = '2024-11-05 15:18:16', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1000.00',discount='', reciptid='0', dailyentryid = '118946',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1000',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235861';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235861 -clientdebtchangeId = 235861
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:48:41";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:18:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:18:41', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:48:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:18:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 15:18:54', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:49:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:19:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 15:19:05', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:49:11";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:19:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:19:11', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143142');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:49:19";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:19:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 15:19:19', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('جهاد محمد ' , '', '01148924806', '', '0', '', '0', '2024-11-05 15:20:01', '9', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10282', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10282','0','0','0','إضافة عميل جديد','10282', '0', '2024-11-05 15:20:01', '9', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('جهاد محمد ', 'جهاد محمد ', 'جهاد محمد ', 'جهاد محمد ', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '9', '0', '2024-11-05 15:20:01');
UPDATE client SET clientname = 'جهاد محمد ', clientaddress = '', clientphone = '01148924806', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '9'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11206',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10282';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:50:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:20:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:20:32', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1acd3e990
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10282,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:17:01', '0672a1acd3e990', '10282', '0.00', '1010', '0', '1', '1010.00', '1010', '0', '1010', '1', '2024-11-05 15:20:32', '', '9', '0', 'جهاد محمد ', '1', '1', '3', '73', 'جهاد محمد ', '2' ,'0','','','','','-1','0','0','0','0','0','1010','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1010', userid = '9' WHERE clientid = '10282';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10282','0.00','1010','0','اضافة فاتورة مبيعات','143258', '1010', '2024-11-05 15:20:32', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1010', '0', null, '0', null, null,'', '0','1','1','1010','1','2024-11-05 15:17:01','0','0');
UPDATE client SET  inUse = 0 where clientid = 10282;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34303;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('650','H1365', '143258', '14', '15506', '1', '1000', '1000', '0', '', '1', '2024-11-05 15:20:32', '15506', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34303-1,','1','1','0','0','1000','1000','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 650.00, meanbuyprice_withDiscount = 650.00
        
                where sellbilldetailid = 523636;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15506, '2024-11-05', 1000, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1000, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-05 15:20:32' WHERE storedetailid = '15505';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15506', '1', '1', '1', '143258', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '9', '2024-11-05 15:20:32','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143258', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-05 15:20:32', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 73 where clientid = 10282;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1010, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1010, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10282, '2024-11-05', 1010, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1010, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1010, 650, 650
                    , 650, 650, 650, 650, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1010, netSellCostBuyPrice = netSellCostBuyPrice+650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+650
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+650
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+650
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1acd3e990 and sellbillId = 143258 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:50:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:20:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:20:33', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:51:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:21:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:21:38', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1af40ebd3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:17:40', '0672a1af40ebd3', '1', '0.00', '0', '0', '1', '880.00', '880', '880', '0', '1', '2024-11-05 15:21:38', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','880','0','','0','0','880','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143259', '0', '2024-11-05 15:21:38', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '880', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:17:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26933;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05526', '143259', '5', '12019', '1', '580', '580', '0', '', '1', '2024-11-05 15:21:38', '12019', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26933-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 1190.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 1190.00
        
                where sellbilldetailid = 523638;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12019, '2024-11-05', 580, 495, 495
                    , 1190, 495, 1190, 488.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+488.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 495, 495
                    , 1190, 495, 1190, 488.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+488.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 15:21:38' WHERE storedetailid = '12018';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12019', '1', '1', '1', '143259', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 15:21:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33792;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06440', '143259', '5', '14652', '1', '300', '300', '0', '', '1', '2024-11-05 15:21:38', '14652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33792-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 523639;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14652, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 15:21:38' WHERE storedetailid = '14651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14652', '1', '1', '1', '143259', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-05 15:21:38','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '33760',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('32880','880', '0', '1', 'اضافة فاتورة مبيعات', '143259', '33760', '2024-11-05 15:21:38', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 880, 735, 735
                    , 1430, 735, 1430, 728.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+880, sellCostBuyPrice =sellCostBuyPrice+735
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+735, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+735, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+728.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 880, 735, 735
                    , 1430, 735, 1430, 728.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+880, sellCostBuyPrice =sellCostBuyPrice+735
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+735, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+735, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+728.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 880, 735, 735
                    , 1430, 735, 1430, 728.33, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+880, netSellCostBuyPrice = netSellCostBuyPrice+735
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+735
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1430
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+735
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1430
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+728.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1af40ebd3 and sellbillId = 143259 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:51:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:21:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:21:39', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:52:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:22:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:22:44', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:53:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:23:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:23:09', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة سيل', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '33660',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('33760.00','100', '1', '1', 'إضافة مصروف', '24284', '33660', '2024-11-05 15:23:10', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة سيل', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24284';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:53:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:23:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:23:10', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:53:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:23:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:23:12', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:53:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:23:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:23:20', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:55:04";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:25:04", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:25:04', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a159adcc14
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9423,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:54:50', '0672a159adcc14', '9423', '0.00', '990', '0', '1', '990.00', '990', '0', '990', '1', '2024-11-05 15:25:04', '', '75', '0', 'مكتب ريمو k235', '2', '1', '3', '52', 'مكتب ريمو k235', '5' ,'0','','','','','-1','0','0','0','0','0','990','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '990', userid = '75' WHERE clientid = '9423';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9423','0.00','990','0','اضافة فاتورة مبيعات','143260', '990', '2024-11-05 15:25:04', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '990', '0', null, '0', null, null,'', '0','1','1','990','1','2024-11-05 14:54:50','0','0');
UPDATE client SET  inUse = 0 where clientid = 9423;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34516;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1372', '143260', '14', '15554', '1', '550', '550', '0', '', '1', '2024-11-05 15:25:04', '15554', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34516-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523640;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15554, '2024-11-05', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 15:25:04' WHERE storedetailid = '15553';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15554', '1', '1', '1', '143260', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 15:25:04','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','06260', '143260', '5', '14264', '1', '210', '210', '0', '', '1', '2024-11-05 15:25:04', '14264', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523641;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14264, '2024-11-05', 210, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 15:25:04' WHERE storedetailid = '14263';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14264', '1', '1', '1', '143260', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 15:25:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34616;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06811', '143260', '5', '15497', '1', '200', '200', '0', '', '1', '2024-11-05 15:25:04', '15497', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34616-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523642;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15497, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 15:25:04' WHERE storedetailid = '15496';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15497', '1', '1', '1', '143260', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 15:25:04','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143260', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 15:25:04', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143260', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-05 15:25:04', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 52 where clientid = 9423;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 990, 870, 870
                    , 870, 870, 870, 870
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,600, 365, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+870
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+870, sellCostMeanBuyPrice = sellCostMeanBuyPrice+870
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+870, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+870
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+870
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+365
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9423, '2024-11-05', 990, 870, 870
                    , 870, 870, 870, 870
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,600, 365, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+870
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+870, sellCostMeanBuyPrice = sellCostMeanBuyPrice+870
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+870, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+870
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+870
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+365
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 990, 870, 870
                    , 870, 870, 870, 870, 600, 365)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+990, netSellCostBuyPrice = netSellCostBuyPrice+870
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+870
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+870
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+870
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+870
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+870
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+600
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+365;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a159adcc14 and sellbillId = 143260 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:55:05";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:25:05", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:25:05', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:56:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:26:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:26:35', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1ba16e078
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:20:33', '0672a1ba16e078', '1', '0.00', '0', '0', '1', '550.00', '550', '550', '0', '1', '2024-11-05 15:26:36', '', '9', '0', 'نقدي', '1', '0', '3', '54', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','550','0','','0','0','550','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143261', '0', '2024-11-05 15:26:36', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '550', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:20:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33778;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06645', '143261', '5', '15113', '1', '550', '550', '0', '', '1', '2024-11-05 15:26:36', '15113', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33778-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 1566.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 1566.00
        
                where sellbilldetailid = 523645;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15113, '2024-11-05', 550, 495, 495
                    , 1566, 495, 1566, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1566
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1566
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 495, 495
                    , 1566, 495, 1566, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1566
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1566
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 15:26:36' WHERE storedetailid = '15112';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15113', '1', '1', '1', '143261', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 15:26:36','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '34210',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('33660','550', '0', '1', 'اضافة فاتورة مبيعات', '143261', '34210', '2024-11-05 15:26:36', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 54 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 550, 495, 495
                    , 1566, 495, 1566, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1566
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1566
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 495, 495
                    , 1566, 495, 1566, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1566
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1566
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 550, 495, 495
                    , 1566, 495, 1566, 495, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+550, netSellCostBuyPrice = netSellCostBuyPrice+495
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+495
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1566
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+495
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1566
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+495
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1ba16e078 and sellbillId = 143261 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:56:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:26:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:26:36', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:57:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:27:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:27:08', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:57:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:27:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:27:26', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1d2d0373e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 15:27:09', '0672a1d2d0373e', '1', '0.00', '0', '0', '1', '540', '540', '-540', '0', '1', '2024-11-05 15:27:26', '', '9', '0', 'نقدي','1', '0', '5', '5', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-540','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16231', '0', '2024-11-05 15:27:26', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '540', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:27:09','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('480.00', '06805', '16231', '5', '15488', '1', '540', '540', '0', '', '1', '0', '15488', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','540','540','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 480.00
        
                where returnsellbilldetailid = 21271;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15488, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 540, 480, 480, 480
                    , 480, 480, 480, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+540, returnSellCostBuyPrice = returnSellCostBuyPrice+480, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+480
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+480, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+480
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+480
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+480
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 540, 480, 480, 480
                    , 480, 480, 480, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+540, returnSellCostBuyPrice = returnSellCostBuyPrice+480, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+480
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+480, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+480
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+480
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+480
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-05 15:27:26' WHERE storedetailid = '15487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15488', '1', '1', '0', '16231', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '15', '16', '9', '2024-11-05 15:27:26','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '33670',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('34210','-540', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16231', '33670', '2024-11-05 15:27:26', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 5 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 540, 480, 480, 480
                    , 480, 480, 480 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+540, returnSellCostBuyPrice = returnSellCostBuyPrice+480, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+480
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+480, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+480
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+480
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+480
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 540, 480, 480, 480
                    , 480, 480, 480 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+540, returnSellCostBuyPrice = returnSellCostBuyPrice+480, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+480
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+480, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+480
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+480
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+480
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -540, -480, -480
                    , -480, -480, -480, -480, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-540, netSellCostBuyPrice = netSellCostBuyPrice+-480
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-480
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-480
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-480
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-480
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-480
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1d2d0373e and sellbillId = 16231 and returnsellbillId = 16231
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:57:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:27:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:27:27', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:57:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:27:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:27:52', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:59:43";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:29:43", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:29:43', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1cb16df7d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5791,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:25:05', '0672a1cb16df7d', '5791', '0.00', '727', '0', '1', '727.00', '727', '0', '727', '1', '2024-11-05 15:29:43', '', '75', '0', 'جنا محمود ابراهيم D83', '2', '1', '3', '85', 'جنا محمود ابراهيم D83', '5' ,'0','','','','','-1','0','0','0','0','0','727','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '727', userid = '75' WHERE clientid = '5791';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5791','0.00','727','0','اضافة فاتورة مبيعات','143262', '727', '2024-11-05 15:29:43', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '727', '0', null, '0', null, null,'', '0','1','1','727','1','2024-11-05 15:25:05','0','0');
UPDATE client SET  inUse = 0 where clientid = 5791;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34555;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06895', '143262', '5', '15667', '1', '240', '240', '0', '', '1', '2024-11-05 15:29:43', '15667', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34555-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 523646;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15667, '2024-11-05', 240, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '75', storedetaildate = '2024-11-05 15:29:43' WHERE storedetailid = '15666';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15667', '1', '1', '1', '143262', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '75', '2024-11-05 15:29:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33788;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06567', '143262', '5', '14977', '1', '190', '190', '0', '', '1', '2024-11-05 15:29:43', '14977', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33788-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        
                where sellbilldetailid = 523647;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14977, '2024-11-05', 190, 140, 140
                    , 141, 140, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 141, 140, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 15:29:43' WHERE storedetailid = '14976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14977', '1', '1', '1', '143262', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 15:29:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33203;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','R3107', '143262', '1', '15015', '1', '270', '270', '0', '', '1', '2024-11-05 15:29:43', '15015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33203-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523648;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15015, '2024-11-05', 270, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 15:29:43' WHERE storedetailid = '15014';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15015', '1', '1', '1', '143262', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-05 15:29:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143262', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 15:29:43', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143262', '17', '10291', '1', '7', '7', '0', '', '1', '2024-11-05 15:29:43', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','7','7','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 5791;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 727, 550, 550
                    , 551, 550, 551, 551
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+727, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+551
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+551
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+551
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5791, '2024-11-05', 727, 550, 550
                    , 551, 550, 551, 551
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+727, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+551
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+551
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+551
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 727, 550, 550
                    , 551, 550, 551, 551, 175, 175)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+727, netSellCostBuyPrice = netSellCostBuyPrice+550
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+550
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+551
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+550
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+551
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+551
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+175
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+175;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1cb16df7d and sellbillId = 143262 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 11:59:44";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:29:44", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:29:44', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:02:29";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:32:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 15:32:29', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:02:48";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:32:48", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:32:48', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a0e357a05c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5955,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:23:17', '0672a0e357a05c', '5955', '0.00', '1626', '0', '1', '1626.00', '1626', '0', '1626', '1', '2024-11-05 15:32:48', '', '75', '0', 'اسماء عبد الهادي x25', '2', '1', '3', '85', 'اسماء عبد الهادي x25', '7' ,'0','','','','','-1','0','0','0','0','0','1626','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1626', userid = '75' WHERE clientid = '5955';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5955','0.00','1626','0','اضافة فاتورة مبيعات','143263', '1626', '2024-11-05 15:32:48', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1626', '0', null, '0', null, null,'', '0','1','1','1626','1','2024-11-05 14:23:17','0','0');
UPDATE client SET  inUse = 0 where clientid = 5955;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34492;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143263', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-05 15:32:48', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34492-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 232.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 232.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 207, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523651;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-05', 290, 230, 230
                    , 232, 230, 232, 238.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+232
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 230, 230
                    , 232, 230, 232, 238.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+232
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '53', userid = '75', storedetaildate = '2024-11-05 15:32:48' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143263', 'اضافة فاتورة مبيعات', 'sellbillController.php', '54', '53', '75', '2024-11-05 15:32:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34511;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3252', '143263', '1', '15632', '1', '210', '210', '0', '', '1', '2024-11-05 15:32:48', '15632', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34511-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523652;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15632, '2024-11-05', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 15:32:48' WHERE storedetailid = '15631';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15632', '1', '1', '1', '143263', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-05 15:32:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34593;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','06695', '143263', '5', '15213', '1', '510', '510', '0', '', '1', '2024-11-05 15:32:48', '15213', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34593-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 458.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 458.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523653;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15213, '2024-11-05', 510, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 510, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 15:32:48' WHERE storedetailid = '15212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15213', '1', '1', '1', '143263', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 15:32:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32322;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2966', '143263', '1', '14553', '1', '280', '280', '0', '', '1', '2024-11-05 15:32:48', '14553', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32322-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523654;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14553, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 15:32:48' WHERE storedetailid = '14552';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14553', '1', '1', '1', '143263', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 15:32:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34774;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R3248', '143263', '1', '15660', '1', '300', '300', '0', '', '1', '2024-11-05 15:32:48', '15660', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34774-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523655;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15660, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 15:32:48' WHERE storedetailid = '15659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15660', '1', '1', '1', '143263', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-05 15:32:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143263', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 15:32:48', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143263', '17', '10291', '1', '16', '16', '0', '', '1', '2024-11-05 15:32:48', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16','16','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 5955;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1626, 1315, 1305
                    , 1315, 1305, 1315, 1314.29
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1085, 752, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1626, sellCostBuyPrice =sellCostBuyPrice+1315
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1315
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1305, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1315
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1314.29
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1085
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+752
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5955, '2024-11-05', 1626, 1315, 1305
                    , 1315, 1305, 1315, 1314.29
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1085, 752, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1626, sellCostBuyPrice =sellCostBuyPrice+1315
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1315
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1305, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1315
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1314.29
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1085
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+752
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1626, 1315, 1305
                    , 1315, 1305, 1315, 1314.29, 1085, 752)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1626, netSellCostBuyPrice = netSellCostBuyPrice+1315
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1305
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1315
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1305
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1315
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1314.29
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1085
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+752;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a0e357a05c and sellbillId = 143263 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:02:49";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:32:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:32:49', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:04:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:34:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:34:50', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1c48e4b94
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:23:20', '0672a1c48e4b94', '1', '0.00', '0', '0', '1', '1550.00', '1550', '1550', '0', '1', '2024-11-05 15:34:50', '', '9', '0', 'نقدي', '1', '0', '3', '94', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','1550','0','','0','0','1550','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143264', '0', '2024-11-05 15:34:50', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1550', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:23:20','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32044;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('445','06350', '143264', '5', '14413', '1', '400', '400', '0', '', '1', '2024-11-05 15:34:50', '14413', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32044-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 2463.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 2463.00
        
                where sellbilldetailid = 523658;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14413, '2024-11-05', 400, 445, 445
                    , 2463, 445, 2463, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2463
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2463
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 445, 445
                    , 2463, 445, 2463, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2463
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2463
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 15:34:50' WHERE storedetailid = '14412';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14413', '1', '1', '1', '143264', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 15:34:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 33493;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','0K774', '143264', '7', '14945', '2', '190', '380', '0', '', '1', '2024-11-05 15:34:50', '14945', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33493-2,','1','1','0','0','190','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        
                where sellbilldetailid = 523659;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14945, '2024-11-05', 380, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 15:34:50' WHERE storedetailid = '14944';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14945', '1', '2', '1', '143264', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '4', '9', '2024-11-05 15:34:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32436;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('110','R2822', '143264', '1', '14077', '1', '95', '95', '0', '', '1', '2024-11-05 15:34:50', '14077', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32436-1,','1','1','0','0','95','95','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 110.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 110.00
        
                where sellbilldetailid = 523660;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14077, '2024-11-05', 95, 110, 110
                    , 110, 110, 110, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 95, 110, 110
                    , 110, 110, 110, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 15:34:50' WHERE storedetailid = '14076';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14077', '1', '1', '1', '143264', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 15:34:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34549;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06885', '143264', '5', '15662', '1', '210', '210', '0', '', '1', '2024-11-05 15:34:51', '15662', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34549-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where sellbilldetailid = 523661;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15662, '2024-11-05', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 15:34:51' WHERE storedetailid = '15661';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15662', '1', '1', '1', '143264', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 15:34:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 22032;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','04623', '143264', '5', '10061', '1', '195', '195', '0', '', '1', '2024-11-05 15:34:51', '10061', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','22032-1,','1','1','0','0','195','195','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523662;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10061, '2024-11-05', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 195, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-05 15:34:51' WHERE storedetailid = '10060';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10061', '1', '1', '1', '143264', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-05 15:34:51','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2569', '143264', '1', '12500', '1', '170', '170', '0', '', '1', '2024-11-05 15:34:51', '12500', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','170','170','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523663;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12500, '2024-11-05', 170, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 170, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 15:34:51' WHERE storedetailid = '12499';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12500', '1', '1', '1', '143264', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 15:34:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31220;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('130','B1283', '143264', '2', '14048', '1', '100', '100', '0', '', '1', '2024-11-05 15:34:51', '14048', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31220-1,','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 130.00 , meanbuyprice = 130.00, lastbuyprice_withDiscount = 130.00, meanbuyprice_withDiscount = 130.00
        
                where sellbilldetailid = 523664;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14048, '2024-11-05', 100, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 100, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 15:34:51' WHERE storedetailid = '14047';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14048', '1', '1', '1', '143264', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 15:34:51','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '35220',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('33670','1550', '0', '1', 'اضافة فاتورة مبيعات', '143264', '35220', '2024-11-05 15:34:51', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 94 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1550, 1670, 1670
                    , 3688, 1670, 3688, 1673.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1550, sellCostBuyPrice =sellCostBuyPrice+1670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3688
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3688
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1673.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1550, 1670, 1670
                    , 3688, 1670, 3688, 1673.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1550, sellCostBuyPrice =sellCostBuyPrice+1670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3688
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3688
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1673.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1550, 1670, 1670
                    , 3688, 1670, 3688, 1673.33, 155, 155)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1550, netSellCostBuyPrice = netSellCostBuyPrice+1670
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1670
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3688
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1670
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3688
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1673.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+155
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+155;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1c48e4b94 and sellbillId = 143264 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:04:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:34:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:34:51', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:05:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:35:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:35:31', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:05:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:35:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:35:50', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1efbe3a2d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:34:51', '0672a1efbe3a2d', '1', '0.00', '0', '0', '1', '510.00', '510', '510', '0', '1', '2024-11-05 15:35:50', '', '9', '0', 'نقدي', '1', '0', '3', '25', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','510','0','','0','0','510','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143265', '0', '2024-11-05 15:35:50', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '510', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:34:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34813;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06935', '143265', '5', '15812', '1', '210', '210', '0', '', '1', '2024-11-05 15:35:50', '15812', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34813-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where sellbilldetailid = 523665;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15812, '2024-11-05', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 15:35:50' WHERE storedetailid = '15811';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15812', '1', '1', '1', '143265', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 15:35:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34571;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06875', '143265', '5', '15676', '1', '300', '300', '0', '', '1', '2024-11-05 15:35:50', '15676', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34571-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523666;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15676, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 15:35:50' WHERE storedetailid = '15675';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15676', '1', '1', '1', '143265', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-05 15:35:50','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '35730',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35220','510', '0', '1', 'اضافة فاتورة مبيعات', '143265', '35730', '2024-11-05 15:35:50', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 25 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 510, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,395, 395, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+395
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+395
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 510, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,395, 395, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+395
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+395
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 510, 395, 395
                    , 395, 395, 395, 395, 395, 395)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+510, netSellCostBuyPrice = netSellCostBuyPrice+395
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+395
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+395
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+395
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+395
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+395
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+395
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+395;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1efbe3a2d and sellbillId = 143265 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:05:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:35:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:35:51', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:07:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:37:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:37:48', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:09:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:39:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:39:10', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235872
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10220,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 15:39:10', userid = '9' WHERE clientid = '10220';
UPDATE client SET  inUse = 0 where clientid = 10220;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10220','1621.00','1621','1','ايصال تحصيل (( قبض من عميل ))','235872', '0', '2024-11-05 15:37:48', '9', 'clientPayedDeptController.php', '   ', '1621', '0', null, '0', null, null,'', '-1','1','1','1621','1','','798','0');
UPDATE save SET  savecurrentvalue = '37351',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35730.00','1621', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235872', '37351', '2024-11-05 15:39:10', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1621', '1621', '2024-11-05', '9', '0', '0', '2024-11-05 15:39:10','اضافة ايصال سداد للعميل سرين لبنان 100','1','0','0','0','235872','clientPayedDeptController.php?do=show&id=235872');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118947', '-1', '1621', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1621', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118947', '10838', '1621', '','0');
UPDATE accountstree SET name = 'سرين لبنان 100', customName = 'سرين لبنان 100', customNameEn = 'سرين لبنان 100', nameEn = 'سرين لبنان 100', parent = '58', accountNature = '0', theValue = '-1621', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-10-28 11:58:07' WHERE id = '10838';
UPDATE clientdebtchange SET clientid = '10220', clientdebtchangebefore = '1621.000', clientdebtchangeamount = '1621.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235872', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 15:37:48', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1621.00',discount='', reciptid='0', dailyentryid = '118947',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1621',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235872';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235872 -clientdebtchangeId = 235872
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:09:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:39:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:39:11', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:09:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:39:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:39:13', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:09:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:39:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:39:15', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:09:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:39:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:39:32', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'نسبه وشحن', '', '36', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '37315',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('37351.00','36', '1', '1', 'إضافة مصروف', '24285', '37315', '2024-11-05 15:39:32', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'نسبه وشحن', expensesdetails = '', expensesValue = '36.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24285';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:09:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:39:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:39:32', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:09:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:39:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:39:34', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:11:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:41:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:41:11', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1f37b9192
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:35:51', '0672a1f37b9192', '1', '0.00', '0', '0', '1', '2210.00', '2210', '2210', '0', '1', '2024-11-05 15:41:11', '', '9', '0', 'نقدي', '1', '0', '3', '73', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','2210','0','','0','0','2210','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143266', '0', '2024-11-05 15:41:11', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2210', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:35:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34705;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('560','H1431', '143266', '14', '15751', '1', '630', '630', '0', '', '1', '2024-11-05 15:41:12', '15751', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34705-1,','1','1','0','0','630','630','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 560.00, meanbuyprice_withDiscount = 560.00
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 560
                where sellbilldetailid = 523667;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15751, '2024-11-05', 630, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 560, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 630, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 560, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 15:41:12' WHERE storedetailid = '15750';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15751', '1', '1', '1', '143266', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 15:41:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('595','H1400', '143266', '14', '15652', '1', '650', '650', '0', '', '1', '2024-11-05 15:41:12', '15652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 595.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 595.00
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where sellbilldetailid = 523668;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15652, '2024-11-05', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-2', userid = '9', storedetaildate = '2024-11-05 15:41:12' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '1', '1', '143266', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-1', '-2', '9', '2024-11-05 15:41:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1331', '143266', '14', '15468', '1', '400', '400', '0', '', '1', '2024-11-05 15:41:12', '15468', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 523669;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15468, '2024-11-05', 400, 300, 300
                    , 300, 300, 300, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 300, 300
                    , 300, 300, 300, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-7', userid = '9', storedetaildate = '2024-11-05 15:41:12' WHERE storedetailid = '15467';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15468', '1', '1', '1', '143266', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-6', '-7', '9', '2024-11-05 15:41:12','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34829;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','06938', '143266', '5', '15826', '1', '530', '530', '0', '', '1', '2024-11-05 15:41:12', '15826', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34829-1,','1','1','0','0','530','530','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 440
                where sellbilldetailid = 523670;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15826, '2024-11-05', 530, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 440, 440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 530, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 440, 440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 15:41:12' WHERE storedetailid = '15825';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15826', '1', '1', '1', '143266', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 15:41:12','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '39525',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('37315','2210', '0', '1', 'اضافة فاتورة مبيعات', '143266', '39525', '2024-11-05 15:41:12', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 73 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2210, 1895, 1895
                    , 1895, 1895, 1895, 1595
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1595, 1595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2210, sellCostBuyPrice =sellCostBuyPrice+1895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1895
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1895
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 2210, 1895, 1895
                    , 1895, 1895, 1895, 1595
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1595, 1595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2210, sellCostBuyPrice =sellCostBuyPrice+1895
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1895, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1895
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1895, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1895
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2210, 1895, 1895
                    , 1895, 1895, 1895, 1595, 1595, 1595)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2210, netSellCostBuyPrice = netSellCostBuyPrice+1895
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1895
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1895
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1895
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1895
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1595
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1595
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1595;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1f37b9192 and sellbillId = 143266 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:11:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:41:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:41:12', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:12:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:42:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:42:33', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2078ce18d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:41:12', '0672a2078ce18d', '1', '0.00', '0', '0', '1', '220.00', '220', '220', '0', '1', '2024-11-05 15:42:33', '', '9', '0', 'نقدي', '1', '0', '3', '25', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','220','0','','0','0','220','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143267', '0', '2024-11-05 15:42:33', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '220', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:41:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0K395', '143267', '7', '9433', '1', '220', '220', '0', '', '1', '2024-11-05 15:42:33', '9433', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 269.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 269.00
        
                where sellbilldetailid = 523671;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9433, '2024-11-05', 220, 210, 210
                    , 269, 210, 269, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 210, 210
                    , 269, 210, 269, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 15:42:33' WHERE storedetailid = '9432';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9433', '1', '1', '1', '143267', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 15:42:33','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '39745',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39525','220', '0', '1', 'اضافة فاتورة مبيعات', '143267', '39745', '2024-11-05 15:42:33', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 25 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 220, 210, 210
                    , 269, 210, 269, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 210, 210
                    , 269, 210, 269, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 220, 210, 210
                    , 269, 210, 269, 210, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+220, netSellCostBuyPrice = netSellCostBuyPrice+210
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+210
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+269
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+210
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+269
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+210
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2078ce18d and sellbillId = 143267 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:12:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:42:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:42:34', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:14:57";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:44:57", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:44:57', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1e81d8345
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5787,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:32:49', '0672a1e81d8345', '5787', '0.00', '909', '0', '1', '909.00', '909', '0', '909', '1', '2024-11-05 15:44:57', '', '75', '0', 'شيماء فكري F4', '2', '1', '3', '86', 'شيماء فكري F4', '4' ,'0','','','','','-1','0','0','0','0','0','909','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '909', userid = '75' WHERE clientid = '5787';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5787','0.00','909','0','اضافة فاتورة مبيعات','143268', '909', '2024-11-05 15:44:57', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '909', '0', null, '0', null, null,'', '0','1','1','909','1','2024-11-05 15:32:49','0','0');
UPDATE client SET  inUse = 0 where clientid = 5787;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34563;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('295','23664', '143268', '5', '15673', '1', '360', '360', '0', '', '1', '2024-11-05 15:44:57', '15673', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34563-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 523672;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15673, '2024-11-05', 360, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 360, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 295, 295, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+295
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+295
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '75', storedetaildate = '2024-11-05 15:44:57' WHERE storedetailid = '15672';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15673', '1', '1', '1', '143268', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '39', '75', '2024-11-05 15:44:57','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34875;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1457', '143268', '14', '15841', '1', '520', '520', '0', '', '1', '2024-11-05 15:44:57', '15841', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34875-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523673;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15841, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-05 15:44:57' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '1', '1', '143268', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-05 15:44:57','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143268', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 15:44:57', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143268', '17', '10291', '1', '9', '9', '0', '', '1', '2024-11-05 15:44:57', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','9','9','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 5787;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 909, 705, 705
                    , 705, 705, 705, 705
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,705, 705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+909, sellCostBuyPrice =sellCostBuyPrice+705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+705
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5787, '2024-11-05', 909, 705, 705
                    , 705, 705, 705, 705
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,705, 705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+909, sellCostBuyPrice =sellCostBuyPrice+705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+705
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 909, 705, 705
                    , 705, 705, 705, 705, 705, 705)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+909, netSellCostBuyPrice = netSellCostBuyPrice+705
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+705
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+705
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+705
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+705
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+705
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+705
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+705;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1e81d8345 and sellbillId = 143268 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:14:58";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:44:58", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:44:58', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:15:46";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 15:45:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 15:45:46', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:16:10";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:46:10", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:46:10', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a215a81a3a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7619,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:44:58', '0672a215a81a3a', '7619', '15.00', '318', '0', '1', '303.00', '303', '0', '303', '1', '2024-11-05 15:46:10', '', '75', '0', 'مارتينا ايمن اسوان f601', '2', '1', '3', '86', 'مارتينا ايمن اسوان f601', '2' ,'0','','','','','-1','0','0','0','0','0','303','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '318', userid = '75' WHERE clientid = '7619';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7619','15.00','303','0','اضافة فاتورة مبيعات','143269', '318', '2024-11-05 15:46:10', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '303', '0', null, '0', null, null,'', '0','1','1','303','1','2024-11-05 15:44:58','0','0');
UPDATE client SET  inUse = 0 where clientid = 7619;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34776;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06922', '143269', '5', '15789', '1', '300', '300', '0', '', '1', '2024-11-05 15:46:10', '15789', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34776-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523676;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15789, '2024-11-05', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 15:46:10' WHERE storedetailid = '15788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15789', '1', '1', '1', '143269', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 15:46:10','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143269', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 15:46:10', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 7619;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 303, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7619, '2024-11-05', 303, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 303, 245, 245
                    , 245, 245, 245, 245, 245, 245)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+303, netSellCostBuyPrice = netSellCostBuyPrice+245
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+245
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+245
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+245
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+245
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+245
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+245
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+245;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a215a81a3a and sellbillId = 143269 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:16:11";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:46:11", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:46:11', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:17:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:47:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:47:28', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:18:14";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:48:14", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:48:14', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a21a39f51b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(397,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:46:11', '0672a21a39f51b', '397', '350.00', '1249', '0', '1', '899.00', '899', '0', '899', '1', '2024-11-05 15:48:15', '', '75', '0', 'اية حسن f6', '2', '1', '3', '86', 'اية حسن f6', '4' ,'0','','','','','-1','0','0','0','0','0','899','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1249', userid = '75' WHERE clientid = '397';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('397','350.00','899','0','اضافة فاتورة مبيعات','143270', '1249', '2024-11-05 15:48:15', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '899', '0', null, '0', null, null,'', '0','1','1','899','1','2024-11-05 15:46:11','0','0');
UPDATE client SET  inUse = 0 where clientid = 397;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34664;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1409', '143270', '14', '15689', '1', '570', '570', '0', '', '1', '2024-11-05 15:48:15', '15689', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34664-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 523678;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15689, '2024-11-05', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-05 15:48:15' WHERE storedetailid = '15688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15689', '1', '1', '1', '143270', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-05 15:48:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34769;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06924', '143270', '5', '15783', '1', '300', '300', '0', '', '1', '2024-11-05 15:48:15', '15783', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34769-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523679;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15783, '2024-11-05', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 15:48:15' WHERE storedetailid = '15782';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15783', '1', '1', '1', '143270', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 15:48:15','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143270', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 15:48:15', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143270', '17', '10291', '1', '9', '9', '0', '', '1', '2024-11-05 15:48:15', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','9','9','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 397;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 899, 725, 725
                    , 725, 725, 725, 725
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,725, 725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+899, sellCostBuyPrice =sellCostBuyPrice+725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+725
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (397, '2024-11-05', 899, 725, 725
                    , 725, 725, 725, 725
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,725, 725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+899, sellCostBuyPrice =sellCostBuyPrice+725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+725
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 899, 725, 725
                    , 725, 725, 725, 725, 725, 725)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+899, netSellCostBuyPrice = netSellCostBuyPrice+725
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+725
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+725
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+725
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+725
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+725
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+725
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+725;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a21a39f51b and sellbillId = 143270 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:18:15";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:48:15", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:48:15', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:18:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:48:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:48:21', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235877
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3677,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-14090' , clientdate = '2024-11-05 15:48:22', userid = '9' WHERE clientid = '3677';
UPDATE client SET  inUse = 0 where clientid = 3677;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3677','-13400.00','690','1','ايصال تحصيل (( قبض من عميل ))','235877', '-14090', '2024-11-05 15:47:28', '9', 'clientPayedDeptController.php', '   ', '690', '0', null, '0', null, null,'', '-1','1','1','690','1','','799','0');
UPDATE save SET  savecurrentvalue = '40435',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39745.00','690', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235878', '40435', '2024-11-05 15:48:22', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '690', '690', '2024-11-05', '9', '0', '0', '2024-11-05 15:48:22','اضافة ايصال سداد للعميل زيادة ','1','0','0','0','235878','clientPayedDeptController.php?do=show&id=235878');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118948', '-1', '690', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '690', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118948', '-1', '690', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-690', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3677', clientdebtchangebefore = '-13400.000', clientdebtchangeamount = '690.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235877', clientdebtchangeafter = '-14090.000', clientdebtchangedate = '2024-11-05 15:47:28', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '690.00',discount='', reciptid='0', dailyentryid = '118948',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='690',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235878';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235877 -clientdebtchangeId = 235878
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:18:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:48:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:48:22', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:18:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:48:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 15:48:24', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:20:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:50:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:50:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:20:56";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:50:56", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:50:56', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a22201577b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3948,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:48:16', '0672a22201577b', '3948', '-222.00', '1318', '0', '1', '1540.00', '1540', '0', '1540', '1', '2024-11-05 15:50:57', '', '75', '0', 'ميادة الشاعر g192', '2', '1', '3', '80', 'ميادة الشاعر g192', '8' ,'0','','','','','-1','0','0','0','0','0','1540','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1318', userid = '75' WHERE clientid = '3948';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3948','-222.00','1540','0','اضافة فاتورة مبيعات','143271', '1318', '2024-11-05 15:50:57', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1540', '0', null, '0', null, null,'', '0','1','1','1540','1','2024-11-05 15:48:16','0','0');
UPDATE client SET  inUse = 0 where clientid = 3948;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100','عرض 100', '143271', '18', '10345', '1', '100', '100', '0', '', '1', '2024-11-05 15:50:57', '10345', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        
                where sellbilldetailid = 523682;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10345, '2024-11-05', 100, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 100, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-60', userid = '75', storedetaildate = '2024-11-05 15:50:57' WHERE storedetailid = '10344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10345', '1', '1', '1', '143271', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-59', '-60', '75', '2024-11-05 15:50:57','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','عرض 150', '143271', '18', '10355', '1', '150', '150', '0', '', '1', '2024-11-05 15:50:57', '10355', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523683;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10355, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-52', userid = '75', storedetaildate = '2024-11-05 15:50:57' WHERE storedetailid = '10354';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10355', '1', '1', '1', '143271', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-51', '-52', '75', '2024-11-05 15:50:57','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','R3226', '143271', '1', '15524', '1', '385', '385', '0', '', '1', '2024-11-05 15:50:57', '15524', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523684;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15524, '2024-11-05', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-4', userid = '75', storedetaildate = '2024-11-05 15:50:57' WHERE storedetailid = '15523';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15524', '1', '1', '1', '143271', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-3', '-4', '75', '2024-11-05 15:50:57','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34671;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06905', '143271', '5', '15738', '1', '270', '270', '0', '', '1', '2024-11-05 15:50:57', '15738', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34671-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 83, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523685;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15738, '2024-11-05', 270, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 83, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+83
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 83, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+83
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 15:50:57' WHERE storedetailid = '15737';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15738', '1', '1', '1', '143271', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 15:50:57','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34384;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06717', '143271', '5', '15245', '1', '320', '320', '0', '', '1', '2024-11-05 15:50:57', '15245', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34384-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 394.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 394.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 173, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523686;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15245, '2024-11-05', 320, 260, 260
                    , 394, 260, 394, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 173, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+394
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+394
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+173
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 260, 260
                    , 394, 260, 394, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 173, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+394
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+394
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+173
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '75', storedetaildate = '2024-11-05 15:50:57' WHERE storedetailid = '15244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15245', '1', '1', '1', '143271', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '75', '2024-11-05 15:50:57','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32348;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','00D55', '143271', '1', '14570', '1', '280', '280', '0', '', '1', '2024-11-05 15:50:57', '14570', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32348-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        
                where sellbilldetailid = 523687;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14570, '2024-11-05', 280, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 15:50:57' WHERE storedetailid = '14569';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14570', '1', '1', '1', '143271', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 15:50:57','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143271', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 15:50:57', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143271', '17', '10291', '1', '15', '15', '0', '', '1', '2024-11-05 15:50:57', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 3948;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1540, 1205, 1205
                    , 1339, 1205, 1339, 955
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,425, 256, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1540, sellCostBuyPrice =sellCostBuyPrice+1205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1339
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1339
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+955
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+256
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3948, '2024-11-05', 1540, 1205, 1205
                    , 1339, 1205, 1339, 955
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,425, 256, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1540, sellCostBuyPrice =sellCostBuyPrice+1205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1339
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1339
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+955
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+256
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1540, 1205, 1205
                    , 1339, 1205, 1339, 955, 425, 256)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1540, netSellCostBuyPrice = netSellCostBuyPrice+1205
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1205
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1339
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1205
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1339
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+955
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+425
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+256;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a22201577b and sellbillId = 143271 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:20:58";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:50:58", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:50:58', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:21:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:51:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:51:14', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a22b42a18d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:50:44', '0672a22b42a18d', '1', '0.00', '0', '0', '1', '480.00', '480', '480', '0', '1', '2024-11-05 15:51:14', '', '9', '0', 'نقدي', '1', '0', '3', '54', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','480','0','','0','0','480','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143272', '0', '2024-11-05 15:51:14', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '480', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 15:50:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143272', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-05 15:51:14', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523690;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '51', userid = '9', storedetaildate = '2024-11-05 15:51:14' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143272', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52', '51', '9', '2024-11-05 15:51:14','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '40915',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40435','480', '0', '1', 'اضافة فاتورة مبيعات', '143272', '40915', '2024-11-05 15:51:14', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 54 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 480, 420, 420
                    , 420, 420, 420, 420, 420, 420)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+480, netSellCostBuyPrice = netSellCostBuyPrice+420
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+420
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+420
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+420
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+420
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+420
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+420
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+420;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a22b42a18d and sellbillId = 143272 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:21:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:51:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:51:15', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:23:05";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:53:05", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:53:05', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a22c28ef0c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7500,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:50:58', '0672a22c28ef0c', '7500', '0.00', '1449', '0', '1', '1449.00', '1449', '0', '1449', '1', '2024-11-05 15:53:05', '', '75', '0', 'نور المنوفية y406', '2', '1', '3', '80', 'نور المنوفية y406', '7' ,'0','','','','','-1','0','0','0','0','0','1449','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1449', userid = '75' WHERE clientid = '7500';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7500','0.00','1449','0','اضافة فاتورة مبيعات','143273', '1449', '2024-11-05 15:53:05', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1449', '0', null, '0', null, null,'', '0','1','1','1449','1','2024-11-05 15:50:58','0','0');
UPDATE client SET  inUse = 0 where clientid = 7500;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34450;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3174', '143273', '1', '15319', '1', '330', '330', '0', '', '1', '2024-11-05 15:53:05', '15319', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34450-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 178, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523691;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15319, '2024-11-05', 330, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 15:53:05' WHERE storedetailid = '15318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15319', '1', '1', '1', '143273', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 15:53:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34510;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06856', '143273', '5', '15631', '1', '300', '300', '0', '', '1', '2024-11-05 15:53:05', '15631', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34510-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 239.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 239.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 238, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523692;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15631, '2024-11-05', 300, 240, 240
                    , 239, 240, 239, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 238, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+239
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+239
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+238
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 239, 240, 239, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 238, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+239
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+239
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+238
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '75', storedetaildate = '2024-11-05 15:53:05' WHERE storedetailid = '15630';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15631', '1', '1', '1', '143273', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '75', '2024-11-05 15:53:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34575;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06860', '143273', '5', '15613', '1', '300', '300', '0', '', '1', '2024-11-05 15:53:05', '15613', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34575-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523693;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15613, '2024-11-05', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 15:53:05' WHERE storedetailid = '15612';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15613', '1', '1', '1', '143273', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 15:53:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34536;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06786', '143273', '5', '15389', '1', '200', '200', '0', '', '1', '2024-11-05 15:53:05', '15389', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34536-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523694;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-05', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '75', storedetaildate = '2024-11-05 15:53:05' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '1', '143273', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '75', '2024-11-05 15:53:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34083;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06760', '143273', '5', '15326', '1', '285', '285', '0', '', '1', '2024-11-05 15:53:05', '15326', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34083-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523695;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15326, '2024-11-05', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 15:53:05' WHERE storedetailid = '15325';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15326', '1', '1', '1', '143273', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 15:53:05','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143273', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 15:53:05', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143273', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-05 15:53:05', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 7500;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1449, 1145, 1145
                    , 1143, 1145, 1143, 1137.92
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,910, 773, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1449, sellCostBuyPrice =sellCostBuyPrice+1145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1143
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1143
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1137.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+910
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+773
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7500, '2024-11-05', 1449, 1145, 1145
                    , 1143, 1145, 1143, 1137.92
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,910, 773, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1449, sellCostBuyPrice =sellCostBuyPrice+1145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1143
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1143
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1137.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+910
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+773
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1449, 1145, 1145
                    , 1143, 1145, 1143, 1137.92, 910, 773)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1449, netSellCostBuyPrice = netSellCostBuyPrice+1145
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1145
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1143
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1145
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1143
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1137.92
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+910
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+773;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a22c28ef0c and sellbillId = 143273 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:23:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:53:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:53:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:23:06";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:53:06", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:53:06', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('مرنا اسيوط 58' , '', '', '01556433931', '0', '', '0', '2024-11-05 15:54:43', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10283', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10283','0','0','0','إضافة عميل جديد','10283', '0', '2024-11-05 15:54:43', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مرنا اسيوط 58', 'مرنا اسيوط 58', 'مرنا اسيوط 58', 'مرنا اسيوط 58', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 15:54:43');
UPDATE client SET clientname = 'مرنا اسيوط 58', clientaddress = '', clientphone = '', clientmobile = '01556433931', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11207',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10283';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:55:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:55:12', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 15:55:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 15:55:23', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:55:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:55:23', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ابو شامة', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40865',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40915.00','50', '1', '1', 'إضافة مصروف', '24286', '40865', '2024-11-05 15:55:24', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ابو شامة', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24286';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:55:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:55:24', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:55:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:55:26', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:55:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:55:26', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:55:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:55:39', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'لاحا', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40765',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40865.00','100', '1', '1', 'إضافة مصروف', '24287', '40765', '2024-11-05 15:55:39', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'لاحا', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24287';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:55:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:55:40', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:55:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 15:55:42', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:58";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:55:58", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:55:58', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2342b9b0e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10283,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:53:06', '0672a2342b9b0e', '10283', '0.00', '710', '0', '1', '710.00', '710', '0', '710', '1', '2024-11-05 15:55:58', '', '75', '0', 'مرنا اسيوط 58', '2', '1', '3', '80', 'مرنا اسيوط 58', '5' ,'0','','','','','-1','0','0','0','0','0','710','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '710', userid = '75' WHERE clientid = '10283';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10283','0.00','710','0','اضافة فاتورة مبيعات','143274', '710', '2024-11-05 15:55:58', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '710', '0', null, '0', null, null,'', '0','1','1','710','1','2024-11-05 15:53:06','0','0');
UPDATE client SET  inUse = 0 where clientid = 10283;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','0H841', '143274', '14', '8864', '1', '365', '365', '0', '', '1', '2024-11-05 15:55:58', '8864', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','365','365','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 523698;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8864, '2024-11-05', 365, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+365, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 365, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+365, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 15:55:58' WHERE storedetailid = '8863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8864', '1', '1', '1', '143274', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 15:55:58','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06263', '143274', '5', '14258', '1', '165', '165', '0', '', '1', '2024-11-05 15:55:58', '14258', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523699;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14258, '2024-11-05', 165, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 15:55:58' WHERE storedetailid = '14257';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14258', '1', '1', '1', '143274', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 15:55:58','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','عرض 150', '143274', '18', '10355', '1', '150', '150', '0', '', '1', '2024-11-05 15:55:58', '10355', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523700;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10355, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-53', userid = '75', storedetaildate = '2024-11-05 15:55:58' WHERE storedetailid = '10354';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10355', '1', '1', '1', '143274', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-52', '-53', '75', '2024-11-05 15:55:58','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143274', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 15:55:58', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143274', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-05 15:55:58', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 10283;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 710, 670, 670
                    , 670, 670, 670, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10283, '2024-11-05', 710, 670, 670
                    , 670, 670, 670, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 710, 670, 670
                    , 670, 670, 670, 520, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+710, netSellCostBuyPrice = netSellCostBuyPrice+670
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+670
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+670
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+670
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+670
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+520
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2342b9b0e and sellbillId = 143274 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:25:59";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 15:55:59", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:55:59', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:27:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 15:57:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 15:57:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:30:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:00:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:00:13', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a243323c5a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3810,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:57:07', '0672a243323c5a', '3810', '0.00', '1060', '0', '1', '1060.00', '1060', '0', '1060', '1', '2024-11-05 16:00:13', '', '9', '0', 'امل محمد 25', '1', '1', '3', '3', 'امل محمد 25', '3' ,'0','','','','','-1','0','0','0','0','0','1060','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1060', userid = '9' WHERE clientid = '3810';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3810','0.00','1060','0','اضافة فاتورة مبيعات','143275', '1060', '2024-11-05 16:00:13', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1060', '0', null, '0', null, null,'', '0','1','1','1060','1','2024-11-05 15:57:07','0','0');
UPDATE client SET  inUse = 0 where clientid = 3810;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33594;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('550','06611', '143275', '5', '15082', '1', '620', '620', '0', '', '1', '2024-11-05 16:00:14', '15082', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33594-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        
                where sellbilldetailid = 523703;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15082, '2024-11-05', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 16:00:14' WHERE storedetailid = '15081';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15082', '1', '1', '1', '143275', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 16:00:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33747;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','06710', '143275', '5', '15223', '1', '430', '430', '0', '', '1', '2024-11-05 16:00:14', '15223', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33747-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 523704;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15223, '2024-11-05', 430, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 16:00:14' WHERE storedetailid = '15222';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15223', '1', '1', '1', '143275', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 16:00:14','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143275', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-05 16:00:14', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 3 where clientid = 3810;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1060, 930, 930
                    , 930, 930, 930, 930
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1060, sellCostBuyPrice =sellCostBuyPrice+930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+930, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+930
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+930
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3810, '2024-11-05', 1060, 930, 930
                    , 930, 930, 930, 930
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1060, sellCostBuyPrice =sellCostBuyPrice+930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+930, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+930
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+930
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1060, 930, 930
                    , 930, 930, 930, 930, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1060, netSellCostBuyPrice = netSellCostBuyPrice+930
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+930
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+930
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+930
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+930
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+930
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a243323c5a and sellbillId = 143275 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:30:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:00:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:00:14', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:35:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:05:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 16:05:45', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:36:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:06:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 16:06:05', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40715',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40765.00','50', '1', '1', 'إضافة مصروف', '24288', '40715', '2024-11-05 16:06:05', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24288';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:36:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:06:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 16:06:06', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:36:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:06:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 16:06:08', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:36:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:06:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:06:15', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a24eee2e8e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:00:14', '0672a24eee2e8e', '1', '0.00', '0', '0', '1', '165.00', '165', '165', '0', '1', '2024-11-05 16:06:15', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','165','0','','0','0','165','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143276', '0', '2024-11-05 16:06:15', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '165', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:00:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34709;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('110','R3241', '143276', '1', '15581', '1', '165', '165', '0', '', '1', '2024-11-05 16:06:15', '15581', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34709-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 111.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 111.00
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 90, lastbuyprice_withDiscountAndTax = 110
                where sellbilldetailid = 523706;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15581, '2024-11-05', 165, 110, 110
                    , 111, 110, 111, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 110, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 110, 110
                    , 111, 110, 111, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-05 16:06:15' WHERE storedetailid = '15580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15581', '1', '1', '1', '143276', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-05 16:06:15','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '40880',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40715','165', '0', '1', 'اضافة فاتورة مبيعات', '143276', '40880', '2024-11-05 16:06:15', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 165, 110, 110
                    , 111, 110, 111, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,110, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 110, 110
                    , 111, 110, 111, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,110, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 165, 110, 110
                    , 111, 110, 111, 113.33, 110, 90)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+165, netSellCostBuyPrice = netSellCostBuyPrice+110
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+110
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+111
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+110
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+111
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+113.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+110
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+90;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a24eee2e8e and sellbillId = 143276 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:36:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:06:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:06:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:39:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:09:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:09:29', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2658ba8df
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:06:16', '0672a2658ba8df', '1', '0.00', '0', '0', '1', '220.00', '220', '220', '0', '1', '2024-11-05 16:09:29', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','220','0','','0','0','220','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143277', '0', '2024-11-05 16:09:29', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '220', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:06:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34517;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3262', '143277', '1', '15636', '1', '220', '220', '0', '', '1', '2024-11-05 16:09:29', '15636', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34517-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523707;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15636, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-05 16:09:29' WHERE storedetailid = '15635';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15636', '1', '1', '1', '143277', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-05 16:09:29','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '41100',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40880','220', '0', '1', 'اضافة فاتورة مبيعات', '143277', '41100', '2024-11-05 16:09:29', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 220, 165, 165
                    , 165, 165, 165, 165, 165, 165)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+220, netSellCostBuyPrice = netSellCostBuyPrice+165
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+165
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+165
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+165
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+165
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+165
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+165
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+165;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2658ba8df and sellbillId = 143277 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:39:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:09:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:09:30', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:52:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:22:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:22:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE userid = 2;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:54:07";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:24:07", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 16:24:07', '75', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:54:07";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:54:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:24:14", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:24:14', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:54:42";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:24:42", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:24:42', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a23ef9e8e7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3976,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:55:59', '0672a23ef9e8e7', '3976', '0.00', '1429', '0', '1', '1429.00', '1429', '0', '1429', '1', '2024-11-05 16:24:42', '', '75', '0', 'رحاب السيد L195', '2', '1', '3', '80', 'رحاب السيد L195', '6' ,'0','','','','','-1','0','0','0','0','0','1429','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1429', userid = '75' WHERE clientid = '3976';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3976','0.00','1429','0','اضافة فاتورة مبيعات','143278', '1429', '2024-11-05 16:24:42', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1429', '0', null, '0', null, null,'', '0','1','1','1429','1','2024-11-05 15:55:59','0','0');
UPDATE client SET  inUse = 0 where clientid = 3976;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34727;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','15761', '143278', '1', '15761', '1', '385', '385', '0', '', '1', '2024-11-05 16:24:42', '15761', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34727-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 252, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523708;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15761, '2024-11-05', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 16:24:42' WHERE storedetailid = '15760';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15761', '1', '1', '1', '143278', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 16:24:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32019;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R2922', '143278', '1', '14396', '1', '320', '320', '0', '', '1', '2024-11-05 16:24:42', '14396', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32019-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523709;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14396, '2024-11-05', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 16:24:42' WHERE storedetailid = '14395';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14396', '1', '1', '1', '143278', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 16:24:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34288;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','H1363', '143278', '14', '15503', '1', '450', '450', '0', '', '1', '2024-11-05 16:24:42', '15503', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34288-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523710;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15503, '2024-11-05', 450, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 450, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 16:24:42' WHERE storedetailid = '15502';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15503', '1', '1', '1', '143278', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 16:24:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32715;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','R3042', '143278', '1', '14748', '1', '240', '240', '0', '', '1', '2024-11-05 16:24:42', '14748', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32715-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        
                where sellbilldetailid = 523711;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14748, '2024-11-05', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 16:24:42' WHERE storedetailid = '14747';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14748', '1', '1', '1', '143278', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 16:24:42','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143278', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:24:42', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143278', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-05 16:24:42', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 3976;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1429, 1135, 1135
                    , 1135, 1135, 1135, 1135
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1429, sellCostBuyPrice =sellCostBuyPrice+1135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3976, '2024-11-05', 1429, 1135, 1135
                    , 1135, 1135, 1135, 1135
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1429, sellCostBuyPrice =sellCostBuyPrice+1135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1429, 1135, 1135
                    , 1135, 1135, 1135, 1135, 330, 252)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1429, netSellCostBuyPrice = netSellCostBuyPrice+1135
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1135
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1135
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1135
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1135
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1135
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+252;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a23ef9e8e7 and sellbillId = 143278 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:54:43";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:24:43", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:24:43', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:56:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:26:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:26:39', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2aab5de16
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3976,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:24:43', '0672a2aab5de16', '3976', '1429.00', '3136', '0', '1', '1707.00', '1707', '0', '1707', '1', '2024-11-05 16:26:40', '', '75', '0', 'رحاب السيد L195', '2', '1', '3', '80', 'رحاب السيد L195', '7' ,'0','','','','','-1','0','0','0','0','0','1707','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '3136', userid = '75' WHERE clientid = '3976';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3976','1429.00','1707','0','اضافة فاتورة مبيعات','143279', '3136', '2024-11-05 16:26:40', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1707', '0', null, '0', null, null,'', '0','1','1','1707','1','2024-11-05 16:24:43','0','0');
UPDATE client SET  inUse = 0 where clientid = 3976;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33966;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('550','06696', '143279', '5', '15232', '1', '620', '620', '0', '', '1', '2024-11-05 16:26:40', '15232', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33966-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        
                where sellbilldetailid = 523714;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15232, '2024-11-05', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 16:26:40' WHERE storedetailid = '15231';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15232', '1', '1', '1', '143279', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 16:26:40','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','15364', '143279', '1', '15364', '1', '310', '310', '0', '', '1', '2024-11-05 16:26:40', '15364', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        
                where sellbilldetailid = 523715;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15364, '2024-11-05', 310, 260, 260
                    , 260, 260, 260, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 260, 260
                    , 260, 260, 260, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 16:26:40' WHERE storedetailid = '15363';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15364', '1', '1', '1', '143279', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 16:26:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34595;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('110','R3222', '143279', '1', '15504', '1', '165', '165', '0', '', '1', '2024-11-05 16:26:40', '15504', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34595-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 111.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 111.00
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 72, lastbuyprice_withDiscountAndTax = 110
                where sellbilldetailid = 523716;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15504, '2024-11-05', 165, 110, 110
                    , 111, 110, 111, 112.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 110, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+112.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+72
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 110, 110
                    , 111, 110, 111, 112.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+112.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+72
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 16:26:40' WHERE storedetailid = '15503';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15504', '1', '1', '1', '143279', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 16:26:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34604;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('110','R3219', '143279', '1', '15489', '1', '165', '165', '0', '', '1', '2024-11-05 16:26:40', '15489', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34604-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 110.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 110.00
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 79, lastbuyprice_withDiscountAndTax = 110
                where sellbilldetailid = 523717;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15489, '2024-11-05', 165, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 110, 79, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+79
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 79, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+79
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-05 16:26:40' WHERE storedetailid = '15488';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15489', '1', '1', '1', '143279', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-05 16:26:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33364;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06624', '143279', '5', '15087', '1', '410', '410', '0', '', '1', '2024-11-05 16:26:40', '15087', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33364-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523718;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15087, '2024-11-05', 410, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 410, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 16:26:40' WHERE storedetailid = '15086';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15087', '1', '1', '1', '143279', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 16:26:40','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143279', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:26:40', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143279', '17', '10291', '1', '17', '17', '0', '', '1', '2024-11-05 16:26:40', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','17','17','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 3976;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1707, 1380, 1380
                    , 1381, 1380, 1381, 1122.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 151, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1707, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1381
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1381
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1122.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+151
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3976, '2024-11-05', 1707, 1380, 1380
                    , 1381, 1380, 1381, 1122.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 151, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1707, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1381
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1381
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1122.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+151
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1707, 1380, 1380
                    , 1381, 1380, 1381, 1122.5, 220, 151)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1707, netSellCostBuyPrice = netSellCostBuyPrice+1380
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1380
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1381
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1380
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1381
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1122.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+151;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2aab5de16 and sellbillId = 143279 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:56:41";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:26:41", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:26:41', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:58:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:28:08", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:28:08', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2a8e954b6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(340,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:24:14', '0672a2a8e954b6', '340', '0.00', '2798', '0', '1', '2798.00', '2798', '0', '2798', '1', '2024-11-05 16:28:08', '', '75', '0', 'رضوي طارق', '2', '1', '3', '79', 'رضوي طارق', '9' ,'0','','','','','-1','0','0','0','0','0','2798','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2798', userid = '75' WHERE clientid = '340';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('340','0.00','2798','0','اضافة فاتورة مبيعات','143280', '2798', '2024-11-05 16:28:08', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2798', '0', null, '0', null, null,'', '0','1','1','2798','1','2024-11-05 16:24:14','0','0');
UPDATE client SET  inUse = 0 where clientid = 340;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33815;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06557', '143280', '5', '14965', '1', '550', '550', '0', '', '1', '2024-11-05 16:28:08', '14965', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33815-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 523721;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14965, '2024-11-05', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-05 16:28:08' WHERE storedetailid = '14964';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14965', '1', '1', '1', '143280', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-05 16:28:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34591;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06874', '143280', '5', '15687', '1', '380', '380', '0', '', '1', '2024-11-05 16:28:08', '15687', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34591-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 523722;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15687, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '75', storedetaildate = '2024-11-05 16:28:08' WHERE storedetailid = '15686';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15687', '1', '1', '1', '143280', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '75', '2024-11-05 16:28:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','H1408', '143280', '14', '15693', '1', '600', '600', '0', '', '1', '2024-11-05 16:28:08', '15693', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34605-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 523723;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15693, '2024-11-05', 600, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 600, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '75', storedetaildate = '2024-11-05 16:28:08' WHERE storedetailid = '15692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15693', '1', '1', '1', '143280', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '75', '2024-11-05 16:28:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34815;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K792', '143280', '7', '15813', '1', '350', '350', '0', '', '1', '2024-11-05 16:28:08', '15813', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34815-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 279.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 279.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 278, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523724;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15813, '2024-11-05', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '35', userid = '75', storedetaildate = '2024-11-05 16:28:08' WHERE storedetailid = '15812';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15813', '1', '1', '1', '143280', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '35', '75', '2024-11-05 16:28:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34857;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06946', '143280', '5', '15833', '1', '230', '230', '0', '', '1', '2024-11-05 16:28:08', '15833', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34857-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 523725;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15833, '2024-11-05', 230, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 230, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 16:28:08' WHERE storedetailid = '15832';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15833', '1', '1', '1', '143280', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 16:28:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33440;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('290','06590', '143280', '5', '15032', '1', '340', '340', '0', '', '1', '2024-11-05 16:28:08', '15032', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33440-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 290.00 , meanbuyprice = 290.00, lastbuyprice_withDiscount = 290.00, meanbuyprice_withDiscount = 290.00
        
                where sellbilldetailid = 523726;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15032, '2024-11-05', 340, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 16:28:08' WHERE storedetailid = '15031';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15032', '1', '1', '1', '143280', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 16:28:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34708;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06880', '143280', '5', '15692', '1', '300', '300', '0', '', '1', '2024-11-05 16:28:08', '15692', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34708-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523727;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15692, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-05 16:28:08' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '1', '1', '143280', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-05 16:28:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143280', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:28:08', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143280', '17', '10291', '1', '28', '28', '0', '', '1', '2024-11-05 16:28:08', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','28','28','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 340;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2798, 2335, 2335
                    , 2329, 2335, 2329, 2323.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1550, 1543, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2798, sellCostBuyPrice =sellCostBuyPrice+2335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2329
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2329
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2323.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1543
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (340, '2024-11-05', 2798, 2335, 2335
                    , 2329, 2335, 2329, 2323.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1550, 1543, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2798, sellCostBuyPrice =sellCostBuyPrice+2335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2329
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2329
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2323.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1543
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2798, 2335, 2335
                    , 2329, 2335, 2329, 2323.75, 1550, 1543)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2798, netSellCostBuyPrice = netSellCostBuyPrice+2335
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2335
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2329
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2335
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2329
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2323.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1550
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1543;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2a8e954b6 and sellbillId = 143280 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:58:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:28:09", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:28:09', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:58:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:28:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:28:32', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2a1b36544
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:22:19', '0672a2a1b36544', '1', '0.00', '0', '0', '1', '320.00', '320', '320', '0', '1', '2024-11-05 16:28:32', '', '9', '0', 'نقدي', '1', '0', '3', '96', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','320','0','','0','0','320','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143281', '0', '2024-11-05 16:28:32', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '320', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:22:19','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34710;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06903', '143281', '5', '15753', '1', '320', '320', '0', '', '1', '2024-11-05 16:28:32', '15753', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34710-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523730;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15753, '2024-11-05', 320, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '9', storedetaildate = '2024-11-05 16:28:32' WHERE storedetailid = '15752';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15753', '1', '1', '1', '143281', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '9', '2024-11-05 16:28:32','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '41420',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('41100','320', '0', '1', 'اضافة فاتورة مبيعات', '143281', '41420', '2024-11-05 16:28:32', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 96 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 320, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 320, 260, 260
                    , 260, 260, 260, 260, 260, 260)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+320, netSellCostBuyPrice = netSellCostBuyPrice+260
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+260
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+260
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+260
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+260
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+260;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2a1b36544 and sellbillId = 143281 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:58:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:28:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:28:33', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:59:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:29:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:29:55', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2b2133971
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7680,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:26:41', '0672a2b2133971', '7680', '-104.00', '1249', '0', '1', '1353.00', '1353', '0', '1353', '1', '2024-11-05 16:29:55', '', '75', '0', 'خلود حسن Z904', '2', '1', '3', '98', 'خلود حسن Z904', '5' ,'0','','','','','-1','0','0','0','0','0','1353','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1249', userid = '75' WHERE clientid = '7680';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7680','-104.00','1353','0','اضافة فاتورة مبيعات','143282', '1249', '2024-11-05 16:29:55', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1353', '0', null, '0', null, null,'', '0','1','1','1353','1','2024-11-05 16:26:41','0','0');
UPDATE client SET  inUse = 0 where clientid = 7680;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34378;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06823', '143282', '5', '15546', '1', '370', '370', '0', '', '1', '2024-11-05 16:29:55', '15546', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34378-1,','1','1','0','0','370','370','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 523731;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15546, '2024-11-05', 370, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 370, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 16:29:55' WHERE storedetailid = '15545';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15546', '1', '1', '1', '143282', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 16:29:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20589;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','0K400', '143282', '7', '9473', '1', '360', '360', '0', '', '1', '2024-11-05 16:29:55', '9473', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20589-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 523732;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9473, '2024-11-05', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 16:29:55' WHERE storedetailid = '9472';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9473', '1', '1', '1', '143282', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 16:29:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31569;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('560','0A289', '143282', '6', '14184', '1', '590', '590', '0', '', '1', '2024-11-05 16:29:55', '14184', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31569-1,','1','1','0','0','590','590','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 560.00, meanbuyprice_withDiscount = 560.00
        
                where sellbilldetailid = 523733;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14184, '2024-11-05', 590, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+590, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 590, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+590, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 16:29:55' WHERE storedetailid = '14183';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14184', '1', '1', '1', '143282', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 16:29:55','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143282', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:29:55', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143282', '17', '10291', '1', '13', '13', '0', '', '1', '2024-11-05 16:29:55', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','13','13','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 7680;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1353, 1180, 1180
                    , 1180, 1180, 1180, 1180
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1353, sellCostBuyPrice =sellCostBuyPrice+1180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7680, '2024-11-05', 1353, 1180, 1180
                    , 1180, 1180, 1180, 1180
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1353, sellCostBuyPrice =sellCostBuyPrice+1180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1353, 1180, 1180
                    , 1180, 1180, 1180, 1180, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1353, netSellCostBuyPrice = netSellCostBuyPrice+1180
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1180
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1180
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1180
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1180
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1180
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2b2133971 and sellbillId = 143282 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 12:59:56";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:29:56", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:29:56', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:00:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:30:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:30:32', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2b916c440
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:28:33', '0672a2b916c440', '1', '0.00', '0', '0', '1', '770.00', '770', '770', '0', '1', '2024-11-05 16:30:32', '', '9', '0', 'نقدي', '1', '0', '3', '3', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','770','0','','0','0','770','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143283', '0', '2024-11-05 16:30:32', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '770', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:28:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34724;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','0K790', '143283', '7', '15758', '1', '240', '240', '0', '', '1', '2024-11-05 16:30:32', '15758', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34724-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 95, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 523736;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15758, '2024-11-05', 240, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 190, 95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 16:30:32' WHERE storedetailid = '15757';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15758', '1', '1', '1', '143283', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 16:30:32','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','06767', '143283', '5', '15358', '1', '530', '530', '0', '', '1', '2024-11-05 16:30:32', '15358', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','530','530','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        
                where sellbilldetailid = 523737;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15358, '2024-11-05', 530, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 530, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '9', storedetaildate = '2024-11-05 16:30:32' WHERE storedetailid = '15357';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15358', '1', '1', '1', '143283', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '9', '2024-11-05 16:30:32','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42190',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('41420','770', '0', '1', 'اضافة فاتورة مبيعات', '143283', '42190', '2024-11-05 16:30:32', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 3 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 770, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,190, 95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+770, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 770, 650, 650
                    , 650, 650, 650, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,190, 95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+770, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 770, 650, 650
                    , 650, 650, 650, 650, 190, 95)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+770, netSellCostBuyPrice = netSellCostBuyPrice+650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+650
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+650
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+650
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+190
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+95;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2b916c440 and sellbillId = 143283 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:00:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:30:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:30:33', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:03:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:33:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:33:06', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2c097d05c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:30:33', '0672a2c097d05c', '1', '0.00', '0', '0', '1', '740.00', '740', '740', '0', '1', '2024-11-05 16:33:06', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','740','0','','0','0','740','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143284', '0', '2024-11-05 16:33:06', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '740', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:30:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34453;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('620','H1389', '143284', '14', '15593', '1', '740', '740', '0', '', '1', '2024-11-05 16:33:06', '15593', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34453-1,','1','1','0','0','740','740','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 620.00 , meanbuyprice = 620.00, lastbuyprice_withDiscount = 620.00, meanbuyprice_withDiscount = 620.00
        , lastbuyprice_withTax = 620, meanbuyprice_withTax = 620, lastbuyprice_withDiscountAndTax = 620
                where sellbilldetailid = 523738;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15593, '2024-11-05', 740, 620, 620
                    , 620, 620, 620, 620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 620, 620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 740, 620, 620
                    , 620, 620, 620, 620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 620, 620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 16:33:06' WHERE storedetailid = '15592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15593', '1', '1', '1', '143284', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 16:33:06','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42930',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42190','740', '0', '1', 'اضافة فاتورة مبيعات', '143284', '42930', '2024-11-05 16:33:06', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 740, 620, 620
                    , 620, 620, 620, 620
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,620, 620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 740, 620, 620
                    , 620, 620, 620, 620
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,620, 620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+740, sellCostBuyPrice =sellCostBuyPrice+620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 740, 620, 620
                    , 620, 620, 620, 620, 620, 620)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+740, netSellCostBuyPrice = netSellCostBuyPrice+620
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+620
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+620
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+620
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+620
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+620
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+620
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+620;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2c097d05c and sellbillId = 143284 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:03:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:33:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:33:07', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:04:50";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:34:50", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:34:50', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a1dc893e91
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7385,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 15:29:44', '0672a1dc893e91', '7385', '440.00', '728', '0', '1', '288.00', '288', '0', '288', '1', '2024-11-05 16:34:50', '', '75', '0', 'ام سيلا G125', '2', '1', '3', '98', 'ام سيلا G125', '2' ,'0','','','','','-1','0','0','0','0','0','288','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '728', userid = '75' WHERE clientid = '7385';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7385','440.00','288','0','اضافة فاتورة مبيعات','143285', '728', '2024-11-05 16:34:50', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '288', '0', null, '0', null, null,'', '0','1','1','288','1','2024-11-05 15:29:44','0','0');
UPDATE client SET  inUse = 0 where clientid = 7385;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33218;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06240', '143285', '5', '14193', '1', '285', '285', '0', '', '1', '2024-11-05 16:34:50', '14193', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33218-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523739;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14193, '2024-11-05', 285, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 16:34:50' WHERE storedetailid = '14192';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14193', '1', '1', '1', '143285', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 16:34:50','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143285', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 16:34:50', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 7385;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 288, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+288, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7385, '2024-11-05', 288, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+288, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 288, 220, 220
                    , 220, 220, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+288, netSellCostBuyPrice = netSellCostBuyPrice+220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+220
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a1dc893e91 and sellbillId = 143285 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:04:51";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:34:51", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:34:51', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:05:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:35:08", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:35:08', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2b79bd7cc
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(495,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:28:09', '0672a2b79bd7cc', '495', '21.00', '738', '0', '1', '717.00', '717', '0', '717', '1', '2024-11-05 16:35:08', '', '75', '0', 'ام حنين طنطا Z12', '2', '1', '3', '88', 'ام حنين طنطا Z12', '5' ,'0','','','','','-1','0','0','0','0','0','717','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '738', userid = '75' WHERE clientid = '495';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('495','21.00','717','0','اضافة فاتورة مبيعات','143286', '738', '2024-11-05 16:35:08', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '717', '0', null, '0', null, null,'', '0','1','1','717','1','2024-11-05 16:28:09','0','0');
UPDATE client SET  inUse = 0 where clientid = 495;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34552;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3254', '143286', '1', '15633', '1', '210', '210', '0', '', '1', '2024-11-05 16:35:08', '15633', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34552-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523741;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15633, '2024-11-05', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-05 16:35:08' WHERE storedetailid = '15632';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15633', '1', '1', '1', '143286', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-05 16:35:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34484;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','06858', '143286', '5', '15619', '1', '240', '240', '0', '', '1', '2024-11-05 16:35:08', '15619', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34484-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        , lastbuyprice_withTax = 185, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 185
                where sellbilldetailid = 523742;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15619, '2024-11-05', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 185, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 185, 185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-05 16:35:08' WHERE storedetailid = '15618';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15619', '1', '1', '1', '143286', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-05 16:35:08','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34316;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','06816', '143286', '5', '15516', '1', '240', '240', '0', '', '1', '2024-11-05 16:35:08', '15516', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34316-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
        
                where sellbilldetailid = 523743;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15516, '2024-11-05', 240, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 16:35:08' WHERE storedetailid = '15515';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15516', '1', '1', '1', '143286', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 16:35:08','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143286', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:35:08', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143286', '17', '10291', '1', '7', '7', '0', '', '1', '2024-11-05 16:35:08', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','7','7','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 495;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 717, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+717, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (495, '2024-11-05', 717, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+717, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 717, 530, 530
                    , 530, 530, 530, 530, 350, 350)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+717, netSellCostBuyPrice = netSellCostBuyPrice+530
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+530
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+530
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+530
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+530
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+530
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2b79bd7cc and sellbillId = 143286 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:05:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:35:09", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:35:09', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:06:26";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:36:26", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:36:26', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2be4df7f6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9409,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:29:56', '0672a2be4df7f6', '9409', '-620.00', '2229', '0', '1', '2849.00', '2849', '0', '2849', '1', '2024-11-05 16:36:26', '', '75', '0', 'شروق وليد S100', '2', '1', '3', '90', 'شروق وليد S100', '11' ,'0','','','','','-1','0','0','0','0','0','2849','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2229', userid = '75' WHERE clientid = '9409';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9409','-620.00','2849','0','اضافة فاتورة مبيعات','143287', '2229', '2024-11-05 16:36:26', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2849', '0', null, '0', null, null,'', '0','1','1','2849','1','2024-11-05 16:29:56','0','0');
UPDATE client SET  inUse = 0 where clientid = 9409;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30781;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06117', '143287', '5', '13823', '1', '375', '375', '0', '', '1', '2024-11-05 16:36:26', '13823', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30781-1,','1','1','0','0','375','375','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523746;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13823, '2024-11-05', 375, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+375, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 375, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+375, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '13822';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13823', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-05 16:36:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34369;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','06792', '143287', '5', '15404', '1', '185', '185', '0', '', '1', '2024-11-05 16:36:26', '15404', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34369-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        
                where sellbilldetailid = 523747;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15404, '2024-11-05', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '15403';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15404', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 16:36:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34520;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','R3230', '143287', '1', '15530', '1', '430', '430', '0', '', '1', '2024-11-05 16:36:26', '15530', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34520-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 273, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523748;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15530, '2024-11-05', 430, 360, 360
                    , 355, 360, 355, 353.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+353.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 360, 360
                    , 355, 360, 355, 353.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+353.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '36', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '15529';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15530', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '37', '36', '75', '2024-11-05 16:36:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34444;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1376', '143287', '14', '15583', '1', '465', '465', '0', '', '1', '2024-11-05 16:36:26', '15583', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34444-1,','1','1','0','0','465','465','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 523749;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15583, '2024-11-05', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '15582';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15583', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '75', '2024-11-05 16:36:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34492;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143287', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-05 16:36:26', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34492-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 232.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 232.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 207, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523750;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-05', 290, 230, 230
                    , 232, 230, 232, 238.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+232
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 230, 230
                    , 232, 230, 232, 238.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+232
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '52', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '53', '52', '75', '2024-11-05 16:36:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34031;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06770', '143287', '5', '15351', '1', '220', '220', '0', '', '1', '2024-11-05 16:36:26', '15351', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34031-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        
                where sellbilldetailid = 523751;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15351, '2024-11-05', 220, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '15350';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15351', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 16:36:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34669;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','06901', '143287', '5', '15736', '1', '410', '410', '0', '', '1', '2024-11-05 16:36:26', '15736', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34669-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523752;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15736, '2024-11-05', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 410, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '30', '75', '2024-11-05 16:36:26','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','R3206', '143287', '1', '15575', '1', '290', '290', '0', '', '1', '2024-11-05 16:36:26', '15575', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523753;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15575, '2024-11-05', 290, 235, 235
                    , 235, 235, 235, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 235, 235
                    , 235, 235, 235, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-6', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '15574';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15575', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-5', '-6', '75', '2024-11-05 16:36:26','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33944;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('125','0K752', '143287', '7', '14501', '1', '135', '135', '0', '', '1', '2024-11-05 16:36:26', '14501', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33944-1,','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 125.00 , meanbuyprice = 125.00, lastbuyprice_withDiscount = 125.00, meanbuyprice_withDiscount = 125.00
        
                where sellbilldetailid = 523754;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14501, '2024-11-05', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 135, 125, 125
                    , 125, 125, 125, 128.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+128.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 16:36:26' WHERE storedetailid = '14500';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14501', '1', '1', '1', '143287', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 16:36:26','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143287', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:36:26', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143287', '17', '10291', '1', '29', '29', '0', '', '1', '2024-11-05 16:36:26', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','29','29','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 90 where clientid = 9409;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2849, 2330, 2330
                    , 2327, 2330, 2327, 2099.84
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1330, 1030, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2849, sellCostBuyPrice =sellCostBuyPrice+2330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2327
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2327
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2099.84
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1030
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9409, '2024-11-05', 2849, 2330, 2330
                    , 2327, 2330, 2327, 2099.84
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1330, 1030, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2849, sellCostBuyPrice =sellCostBuyPrice+2330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2327
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2327
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2099.84
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1030
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2849, 2330, 2330
                    , 2327, 2330, 2327, 2099.84, 1330, 1030)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2849, netSellCostBuyPrice = netSellCostBuyPrice+2330
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2327
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2327
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2099.84
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1030;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2be4df7f6 and sellbillId = 143287 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:06:27";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:36:27", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:36:27', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('نعمة داوود 73' , '', '', '01117498464', '0', '', '0', '2024-11-05 16:36:42', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10284', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10284','0','0','0','إضافة عميل جديد','10284', '0', '2024-11-05 16:36:42', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نعمة داوود 73', 'نعمة داوود 73', 'نعمة داوود 73', 'نعمة داوود 73', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 16:36:43');
UPDATE client SET clientname = 'نعمة داوود 73', clientaddress = '', clientphone = '', clientmobile = '01117498464', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11208',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10284';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:08:11";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:38:11", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:38:11', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2d6c0de23
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5406,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:36:28', '0672a2d6c0de23', '5406', '1364.00', '1718', '0', '1', '354.00', '354', '0', '354', '1', '2024-11-05 16:38:12', '', '75', '0', 'ياسمين يحي i335', '2', '1', '3', '81', 'ياسمين يحي i335', '2' ,'0','','','','','-1','0','0','0','0','0','354','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1718', userid = '75' WHERE clientid = '5406';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5406','1364.00','354','0','اضافة فاتورة مبيعات','143288', '1718', '2024-11-05 16:38:12', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '354', '0', null, '0', null, null,'', '0','1','1','354','1','2024-11-05 16:36:28','0','0');
UPDATE client SET  inUse = 0 where clientid = 5406;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143288', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-05 16:38:12', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 282.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 282.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523757;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '80', userid = '75', storedetaildate = '2024-11-05 16:38:12' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143288', 'اضافة فاتورة مبيعات', 'sellbillController.php', '81', '80', '75', '2024-11-05 16:38:12','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143288', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-05 16:38:12', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 5406;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 354, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+354, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5406, '2024-11-05', 354, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+354, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 354, 285, 285
                    , 282, 285, 282, 280.91, 285, 280)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+354, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+282
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+282
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+280.91
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+280;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2d6c0de23 and sellbillId = 143288 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:08:12";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:38:12", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:38:12', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:09:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:39:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:39:19', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2ca3514e3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:33:07', '0672a2ca3514e3', '1', '0.00', '0', '0', '1', '340.00', '340', '340', '0', '1', '2024-11-05 16:39:19', '', '9', '0', 'نقدي', '1', '0', '3', '25', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','340','0','','0','0','340','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143289', '0', '2024-11-05 16:39:19', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '340', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:33:07','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34850;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06930', '143289', '5', '15829', '1', '340', '340', '0', '', '1', '2024-11-05 16:39:19', '15829', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34850-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523759;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15829, '2024-11-05', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-05 16:39:19' WHERE storedetailid = '15828';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15829', '1', '1', '1', '143289', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-05 16:39:19','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '43270',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42930','340', '0', '1', 'اضافة فاتورة مبيعات', '143289', '43270', '2024-11-05 16:39:19', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 25 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 340, 285, 285
                    , 285, 285, 285, 285, 285, 285)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+340, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+285;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2ca3514e3 and sellbillId = 143289 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:09:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:39:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:39:20', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('ميرهان خيري 56' , '', '', '01011004717', '0', '', '0', '2024-11-05 16:39:28', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10285', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10285','0','0','0','إضافة عميل جديد','10285', '0', '2024-11-05 16:39:28', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ميرهان خيري 56', 'ميرهان خيري 56', 'ميرهان خيري 56', 'ميرهان خيري 56', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 16:39:28');
UPDATE client SET clientname = 'ميرهان خيري 56', clientaddress = '', clientphone = '', clientmobile = '01011004717', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11209',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10285';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:10:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:40:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:40:15', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:10:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:40:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:40:17', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:10:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:40:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:40:40', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2e4f565d5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 16:40:15', '0672a2e4f565d5', '1', '0.00', '0', '0', '1', '190', '190', '-190', '0', '1', '2024-11-05 16:40:41', '', '9', '0', 'نقدي','1', '0', '5', '24', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-190','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16232', '0', '2024-11-05 16:40:41', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '190', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:40:15','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('140.00', '06567', '16232', '5', '14977', '1', '190', '190', '0', '', '1', '0', '14977', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','190','190','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        
                where returnsellbilldetailid = 21272;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14977, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 141
                    , 140, 141, 141, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+141, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+141
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+141
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 141
                    , 140, 141, 141, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+141, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+141
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+141
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 16:40:41' WHERE storedetailid = '14976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14977', '1', '1', '0', '16232', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '7', '8', '9', '2024-11-05 16:40:41','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '43080',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('43270','-190', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16232', '43080', '2024-11-05 16:40:41', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 141
                    , 140, 141, 141 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+141, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+141
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+141
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 190, 140, 140, 141
                    , 140, 141, 141 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+190, returnSellCostBuyPrice = returnSellCostBuyPrice+140, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+140
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+141, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+140
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+141
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+141
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -190, -140, -140
                    , -141, -140, -141, -141, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-190, netSellCostBuyPrice = netSellCostBuyPrice+-140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-141
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-141
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-141
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2e4f565d5 and sellbillId = 16232 and returnsellbillId = 16232
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:10:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:40:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:40:41', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:10:49";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:40:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 16:40:49', '75', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:11:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:41:06", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 16:41:06', '75', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:12:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:42:31", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:42:31', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2d1d91f8b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10284,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:35:09', '0672a2d1d91f8b', '10284', '0.00', '1055', '0', '1', '1055.00', '1055', '0', '1055', '1', '2024-11-05 16:42:31', '', '75', '0', 'نعمة داوود 73', '2', '1', '3', '79', 'نعمة داوود 73', '7' ,'0','','','','','-1','0','0','0','0','0','1055','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1055', userid = '75' WHERE clientid = '10284';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10284','0.00','1055','0','اضافة فاتورة مبيعات','143290', '1055', '2024-11-05 16:42:31', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1055', '0', null, '0', null, null,'', '0','1','1','1055','1','2024-11-05 16:35:09','0','0');
UPDATE client SET  inUse = 0 where clientid = 10284;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','S1180', '143290', '3', '12766', '1', '165', '165', '0', '', '1', '2024-11-05 16:42:31', '12766', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 268.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 268.00
        
                where sellbilldetailid = 523760;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12766, '2024-11-05', 165, 270, 270
                    , 268, 270, 268, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+268
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+268
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 270, 270
                    , 268, 270, 268, 265
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+268
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+268
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 16:42:31' WHERE storedetailid = '12765';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12766', '1', '1', '1', '143290', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 16:42:31','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('355','R2457', '143290', '1', '11939', '1', '220', '220', '0', '', '1', '2024-11-05 16:42:32', '11939', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 355.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 355.00, meanbuyprice_withDiscount = 355.00
        
                where sellbilldetailid = 523761;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11939, '2024-11-05', 220, 355, 355
                    , 355, 355, 355, 355
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+355, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+355, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+355
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 355, 355
                    , 355, 355, 355, 355
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+355, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+355, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+355
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 16:42:32' WHERE storedetailid = '11938';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11939', '1', '1', '1', '143290', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 16:42:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30700;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','B1252', '143290', '2', '13806', '1', '255', '255', '0', '', '1', '2024-11-05 16:42:32', '13806', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30700-1,','1','1','0','0','255','255','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        
                where sellbilldetailid = 523762;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13806, '2024-11-05', 255, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 255, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 16:42:32' WHERE storedetailid = '13805';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13806', '1', '1', '1', '143290', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 16:42:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29732;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','R2716', '143290', '1', '13315', '1', '200', '200', '0', '', '1', '2024-11-05 16:42:32', '13315', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29732-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        
                where sellbilldetailid = 523763;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13315, '2024-11-05', 200, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 16:42:32' WHERE storedetailid = '13314';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13315', '1', '1', '1', '143290', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 16:42:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26472;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','S1065', '143290', '3', '11808', '1', '185', '185', '0', '', '1', '2024-11-05 16:42:32', '11808', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26472-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 523764;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11808, '2024-11-05', 185, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 16:42:32' WHERE storedetailid = '11807';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11808', '1', '1', '1', '143290', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 16:42:32','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143290', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:42:32', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143290', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-05 16:42:32', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 10284;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1055, 1570, 1570
                    , 1568, 1570, 1568, 1565
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1055, sellCostBuyPrice =sellCostBuyPrice+1570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1570, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1568
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1568
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1565
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10284, '2024-11-05', 1055, 1570, 1570
                    , 1568, 1570, 1568, 1565
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1055, sellCostBuyPrice =sellCostBuyPrice+1570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1570, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1568
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1568
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1565
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1055, 1570, 1570
                    , 1568, 1570, 1568, 1565, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1055, netSellCostBuyPrice = netSellCostBuyPrice+1570
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1570
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1568
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1570
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1568
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1565
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2d1d91f8b and sellbillId = 143290 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:12:32";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:42:32", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:42:32', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:13:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:43:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:43:41', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:13:45";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:43:45", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:43:45', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1459','','14','320','420', '420','420', '2024-11-05', '0', '77', '1', 'H1459', '0', '0', '0', '0', '0', '320','320','320','320','320','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','320','320','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15863, 1,'2024-11-05 16:44:14',77)
                ON DUPLICATE KEY UPDATE productid = 15863, edited = 1, sysdate = '2024-11-05 16:44:14', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15863', '1', '2024-11-05', '77', '0','1586301','420','420','420','320','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15863', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15863', '1', '0', '0', '15863', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:14:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:44:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:44:15', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2f1d45e84
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:43:41', '0672a2f1d45e84', '1', '0.00', '0', '0', '1', '70.00', '70', '70', '0', '1', '2024-11-05 16:44:15', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','70','0','','0','0','70','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143291', '0', '2024-11-05 16:44:15', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '70', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:43:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31551;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('65','00lb5', '143291', '20', '14002', '1', '70', '70', '0', '', '1', '2024-11-05 16:44:15', '14002', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31551-1,','1','1','0','0','70','70','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 65.00 , meanbuyprice = 65.00, lastbuyprice_withDiscount = 65.00, meanbuyprice_withDiscount = 65.00
        
                where sellbilldetailid = 523767;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14002, '2024-11-05', 70, 65, 65
                    , 65, 65, 65, 64.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+70, sellCostBuyPrice =sellCostBuyPrice+65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+65, sellCostMeanBuyPrice = sellCostMeanBuyPrice+65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+64.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 70, 65, 65
                    , 65, 65, 65, 64.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+70, sellCostBuyPrice =sellCostBuyPrice+65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+65, sellCostMeanBuyPrice = sellCostMeanBuyPrice+65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+64.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 16:44:15' WHERE storedetailid = '14001';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14002', '1', '1', '1', '143291', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 16:44:15','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '43150',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('43080','70', '0', '1', 'اضافة فاتورة مبيعات', '143291', '43150', '2024-11-05 16:44:15', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 70, 65, 65
                    , 65, 65, 65, 64.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+70, sellCostBuyPrice =sellCostBuyPrice+65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+65, sellCostMeanBuyPrice = sellCostMeanBuyPrice+65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+64.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 70, 65, 65
                    , 65, 65, 65, 64.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+70, sellCostBuyPrice =sellCostBuyPrice+65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+65, sellCostMeanBuyPrice = sellCostMeanBuyPrice+65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+64.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 70, 65, 65
                    , 65, 65, 65, 64.67, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+70, netSellCostBuyPrice = netSellCostBuyPrice+65
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+65
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+65
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+65
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+65
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+64.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2f1d45e84 and sellbillId = 143291 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:14:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:44:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:44:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1460','','14','420','550', '550','550', '2024-11-05', '0', '77', '1', 'H1460', '0', '0', '0', '0', '0', '420','420','420','420','420','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','420','420','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15864, 1,'2024-11-05 16:44:45',77)
                ON DUPLICATE KEY UPDATE productid = 15864, edited = 1, sysdate = '2024-11-05 16:44:45', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15864', '1', '2024-11-05', '77', '0','1586401','550','550','550','420','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15864', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15864', '1', '0', '0', '15864', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:14:54";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:44:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:44:54', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2dd4e5ab7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10285,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:38:12', '0672a2dd4e5ab7', '10285', '0.00', '3247', '0', '1', '3247.00', '3247', '0', '3247', '1', '2024-11-05 16:44:54', '', '75', '0', 'ميرهان خيري 56', '2', '1', '3', '86', 'ميرهان خيري 56', '9' ,'0','','','','','-1','0','0','0','0','0','3247','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '3247', userid = '75' WHERE clientid = '10285';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10285','0.00','3247','0','اضافة فاتورة مبيعات','143292', '3247', '2024-11-05 16:44:54', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3247', '0', null, '0', null, null,'', '0','1','1','3247','1','2024-11-05 16:38:12','0','0');
UPDATE client SET  inUse = 0 where clientid = 10285;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 24246;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','05118', '143292', '5', '10988', '1', '345', '345', '0', '', '1', '2024-11-05 16:44:54', '10988', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','24246-1,','1','1','0','0','345','345','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        
                where sellbilldetailid = 523768;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10988, '2024-11-05', 345, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+345, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 345, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+345, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 16:44:54' WHERE storedetailid = '10987';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10988', '1', '1', '1', '143292', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 16:44:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26601;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05453', '143292', '5', '11869', '1', '480', '480', '0', '', '1', '2024-11-05 16:44:54', '11869', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26601-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 490.00
        
                where sellbilldetailid = 523769;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11869, '2024-11-05', 480, 495, 495
                    , 490, 495, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 495, 495
                    , 490, 495, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 16:44:54' WHERE storedetailid = '11868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11869', '1', '1', '1', '143292', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 16:44:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 21014;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','H1069', '143292', '14', '9538', '1', '280', '280', '0', '', '1', '2024-11-05 16:44:54', '9538', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','21014-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523770;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9538, '2024-11-05', 280, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 16:44:54' WHERE storedetailid = '9537';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9538', '1', '1', '1', '143292', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 16:44:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 19582;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','0H738', '143292', '14', '8582', '1', '760', '760', '0', '', '1', '2024-11-05 16:44:54', '8582', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','19582-1,','1','1','0','0','760','760','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 657.00, lastbuyprice_withDiscount = 565.00, meanbuyprice_withDiscount = 657.00
        
                where sellbilldetailid = 523771;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8582, '2024-11-05', 760, 600, 565
                    , 657, 565, 657, 576.14
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+760, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+565, sellCostMeanBuyPrice = sellCostMeanBuyPrice+657
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+565, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+657
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+576.14
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 760, 600, 565
                    , 657, 565, 657, 576.14
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+760, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+565, sellCostMeanBuyPrice = sellCostMeanBuyPrice+657
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+565, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+657
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+576.14
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 16:44:54' WHERE storedetailid = '8581';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8582', '1', '1', '1', '143292', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 16:44:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 21760;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('280','H1165', '143292', '14', '9925', '1', '410', '410', '0', '', '1', '2024-11-05 16:44:54', '9925', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','21760-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        
                where sellbilldetailid = 523772;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9925, '2024-11-05', 410, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 410, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-05 16:44:54' WHERE storedetailid = '9924';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9925', '1', '1', '1', '143292', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-05 16:44:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 21382;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('475','H1141', '143292', '14', '9779', '1', '560', '560', '0', '', '1', '2024-11-05 16:44:54', '9779', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','21382-1,','1','1','0','0','560','560','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 475.00, meanbuyprice_withDiscount = 475.00
        
                where sellbilldetailid = 523773;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9779, '2024-11-05', 560, 475, 475
                    , 475, 475, 475, 475
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+560, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+475
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+475
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 560, 475, 475
                    , 475, 475, 475, 475
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+560, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+475
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+475
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-05 16:44:54' WHERE storedetailid = '9778';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9779', '1', '1', '1', '143292', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-05 16:44:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','05332', '143292', '5', '11654', '1', '360', '360', '0', '', '1', '2024-11-05 16:44:54', '11654', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        
                where sellbilldetailid = 523774;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11654, '2024-11-05', 360, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 360, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-2', userid = '75', storedetaildate = '2024-11-05 16:44:54' WHERE storedetailid = '11653';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11654', '1', '1', '1', '143292', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-1', '-2', '75', '2024-11-05 16:44:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143292', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:44:55', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143292', '17', '10291', '1', '32', '32', '0', '', '1', '2024-11-05 16:44:55', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','32','32','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 10285;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 3247, 2860, 2825
                    , 2912, 2825, 2912, 2831.14
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3247, sellCostBuyPrice =sellCostBuyPrice+2860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2912
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2912
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2831.14
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10285, '2024-11-05', 3247, 2860, 2825
                    , 2912, 2825, 2912, 2831.14
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3247, sellCostBuyPrice =sellCostBuyPrice+2860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2912
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2912
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2831.14
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3247, 2860, 2825
                    , 2912, 2825, 2912, 2831.14, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3247, netSellCostBuyPrice = netSellCostBuyPrice+2860
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2825
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2912
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2825
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2912
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2831.14
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2dd4e5ab7 and sellbillId = 143292 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:14:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:44:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:44:55', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('R3279','','1','230','300', '300','300', '2024-11-05', '0', '77', '1', 'R3279', '0', '0', '0', '0', '0', '230','230','230','230','230','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','230','230','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15865, 1,'2024-11-05 16:45:06',77)
                ON DUPLICATE KEY UPDATE productid = 15865, edited = 1, sysdate = '2024-11-05 16:45:06', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15865', '1', '2024-11-05', '77', '0','1586501','300','300','300','230','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15865', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15865', '1', '0', '0', '15865', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:15:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:45:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:45:13', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a2f216a138', '2024-11-05 16:43:45', '230', '19490.00', '34040', '0', '0', '14550',  '14550', '0', '14550', '1', '2024-11-05 16:45:13', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1459', '13617', '14', '15863', '15', '320', '4800', '0', '', '2024-11-05 16:45:13', '15863','','','0','0','0','0','0',null,'320','4800','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:43:45', 1, 15863, 0, 0
                    , 320, 15, 0, 0, 77, '2024-11-05 16:45:13')
                ON DUPLICATE KEY UPDATE buyprice = 320,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:45:13' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15863', '320', '15', '0', 'buyBillController.php', '31350', '', '0', '0');
UPDATE product SET  productBuyPrice = "320" WHERE productId = 15863 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31350 ;
UPDATE product SET productName = 'H1459', productDescription = '', productCatId = '14', productBuyPrice = '320.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1459',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='320',meanbuyprice_withTax='320',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='320'  WHERE productId = '15863';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 320, meanbuyprice_withDiscount = 320
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where buybilldetailid = 31350;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 15863;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15862';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15863', '1', '15', '0', '13617', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:43:45','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1460', '13617', '14', '15864', '15', '420', '6300', '0', '', '2024-11-05 16:45:13', '15864','','','0','0','0','0','0',null,'420','6300','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:43:45', 1, 15864, 0, 0
                    , 420, 15, 0, 0, 77, '2024-11-05 16:45:13')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:45:13' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15864', '420', '15', '0', 'buyBillController.php', '31351', '', '0', '0');
UPDATE product SET  productBuyPrice = "420" WHERE productId = 15864 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31351 ;
UPDATE product SET productName = 'H1460', productDescription = '', productCatId = '14', productBuyPrice = '420.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1460',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '420',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420'  WHERE productId = '15864';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 31351;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 15864;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15864', '1', '15', '0', '13617', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:43:45','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3279', '13617', '1', '15865', '15', '230', '3450', '0', '', '2024-11-05 16:45:13', '15865','','','0','0','0','0','0',null,'230','3450','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:43:45', 1, 15865, 0, 0
                    , 230, 15, 0, 0, 77, '2024-11-05 16:45:13')
                ON DUPLICATE KEY UPDATE buyprice = 230,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:45:13' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15865', '230', '15', '0', 'buyBillController.php', '31352', '', '0', '0');
UPDATE product SET  productBuyPrice = "230" WHERE productId = 15865 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31352 ;
UPDATE product SET productName = 'R3279', productDescription = '', productCatId = '1', productBuyPrice = '230.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3279',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '230',meanbuyprice_withDiscount = '230' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='230',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '15865';
UPDATE buybilldetail SET  lastbuyprice = 230 , meanbuyprice = 230, lastbuyprice_withDiscount = 230, meanbuyprice_withDiscount = 230
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where buybilldetailid = 31352;
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 15865;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15864';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15865', '1', '15', '0', '13617', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:43:45','0','0');
UPDATE supplier SET  suppliercurrentDebt = '34040',suppliercurrentDebtInCurrency= '34040' , userid = '77', supplierdate = '2024-11-05 16:45:13'   WHERE supplierid = '230';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('230', '19490.00', '14550', '0', 'اضافة فاتورة مشتريات', '13617', '34040', '2024-11-05 16:43:45', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','14550','1','19490','14550','34040','0');
update buybill set dailyentryid='0,' where buybillid=13617;
COMMIT;
UPDATE product SET overAllAveragePrice = 320 WHERE productId = 15863;UPDATE product SET overAllAveragePrice = 420 WHERE productId = 15864;UPDATE product SET overAllAveragePrice = 230 WHERE productId = 15865;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:15:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:45:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:45:13', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13617');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:15:17";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:45:17", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 16:45:17', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13617&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:16:17";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:46:17", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:46:17', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6963','','5','180','250', '250','250', '2024-11-05', '0', '77', '1', '06963', '0', '0', '0', '0', '0', '180','180','180','180','180','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','180','180','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15866, 1,'2024-11-05 16:47:02',77)
                ON DUPLICATE KEY UPDATE productid = 15866, edited = 1, sysdate = '2024-11-05 16:47:02', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15866', '1', '2024-11-05', '77', '0','1586601','250','250','250','180','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15866', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15866', '1', '0', '0', '15866', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:17:03";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:47:03", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:47:03', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2ed92fbe4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(198,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:42:33', '0672a2ed92fbe4', '198', '0.00', '950', '0', '1', '950.00', '950', '0', '950', '1', '2024-11-05 16:47:03', '', '75', '0', 'نهاد كرم z403', '2', '1', '3', '88', 'نهاد كرم z403', '5' ,'0','','','','','-1','0','0','0','0','0','950','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '950', userid = '75' WHERE clientid = '198';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('198','0.00','950','0','اضافة فاتورة مبيعات','143293', '950', '2024-11-05 16:47:03', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '950', '0', null, '0', null, null,'', '0','1','1','950','1','2024-11-05 16:42:33','0','0');
UPDATE client SET  inUse = 0 where clientid = 198;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','0H824', '143293', '14', '8819', '1', '360', '360', '0', '', '1', '2024-11-05 16:47:03', '8819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 523777;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8819, '2024-11-05', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 16:47:03' WHERE storedetailid = '8818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8819', '1', '1', '1', '143293', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 16:47:03','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','0K593', '143293', '7', '10957', '1', '320', '320', '0', '', '1', '2024-11-05 16:47:03', '10957', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 523778;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10957, '2024-11-05', 320, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 16:47:03' WHERE storedetailid = '10956';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10957', '1', '1', '1', '143293', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 16:47:03','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34556;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','06877', '143293', '5', '15668', '1', '240', '240', '0', '', '1', '2024-11-05 16:47:03', '15668', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34556-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 523779;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15668, '2024-11-05', 240, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 16:47:03' WHERE storedetailid = '15667';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15668', '1', '1', '1', '143293', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 16:47:03','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143293', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:47:03', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143293', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-05 16:47:03', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 88 where clientid = 198;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 950, 865, 865
                    , 865, 865, 865, 865
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+950, sellCostBuyPrice =sellCostBuyPrice+865
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+865, sellCostMeanBuyPrice = sellCostMeanBuyPrice+865
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+865, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+865
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+865
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (198, '2024-11-05', 950, 865, 865
                    , 865, 865, 865, 865
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+950, sellCostBuyPrice =sellCostBuyPrice+865
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+865, sellCostMeanBuyPrice = sellCostMeanBuyPrice+865
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+865, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+865
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+865
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 950, 865, 865
                    , 865, 865, 865, 865, 190, 190)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+950, netSellCostBuyPrice = netSellCostBuyPrice+865
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+865
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+865
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+865
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+865
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+865
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+190
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+190;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2ed92fbe4 and sellbillId = 143293 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:17:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:47:04", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:47:04', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:17:11";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:47:11", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:47:11', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a2fb9efd31', '2024-11-05 16:46:17', '102', '215805.00', '222405', '0', '0', '6600',  '6600', '0', '6600', '1', '2024-11-05 16:47:11', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06867', '13618', '5', '15642', '30', '130', '3900', '0', '', '2024-11-05 16:47:11', '15642','','','0','0','0','0','0',null,'130','3900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:46:17', 1, 15642, 0, 0
                    , 130, 30, 0, 0, 77, '2024-11-05 16:47:11')
                ON DUPLICATE KEY UPDATE buyprice = 130,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:47:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15642', '130', '30', '0', 'buyBillController.php', '31353', '', '0', '0');
UPDATE product SET  productBuyPrice = "130" WHERE productId = 15642 ;
UPDATE buybilldetail SET  quantitybefore = 18 WHERE buybilldetailid = 31353 ;
UPDATE product SET productName = '6867', productDescription = '', productCatId = '5', productBuyPrice = '130.00', productSellAllPrice = '210.00', productSellUnitPrice = '210.00', productSellHalfPrice = '210.00', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '1', parcode = '06867',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '130',lastbuyprice_withDiscount = '130',meanbuyprice = '130',meanbuyprice_withDiscount = '130' , productbuypricereal = '130.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='130',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='130',meanbuyprice_withTax='130',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='130'  WHERE productId = '15642';
UPDATE buybilldetail SET  lastbuyprice = 130 , meanbuyprice = 130, lastbuyprice_withDiscount = 130, meanbuyprice_withDiscount = 130
        , lastbuyprice_withTax = 130, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 130
                where buybilldetailid = 31353;
UPDATE productunit SET proUnitBuyPrice  = 130 * productnumber WHERE productid = 15642;
UPDATE storedetail SET  productquantity = '48', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15641';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15642', '1', '30', '0', '13618', 'اضافة فاتورة مشتريات', 'buyBillController.php', '18', '48', '77', '2024-11-05 16:46:17','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06963', '13618', '5', '15866', '15', '180', '2700', '0', '', '2024-11-05 16:47:11', '15866','','','0','0','0','0','0',null,'180','2700','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:46:17', 1, 15866, 0, 0
                    , 180, 15, 0, 0, 77, '2024-11-05 16:47:11')
                ON DUPLICATE KEY UPDATE buyprice = 180,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:47:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15866', '180', '15', '0', 'buyBillController.php', '31354', '', '0', '0');
UPDATE product SET  productBuyPrice = "180" WHERE productId = 15866 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31354 ;
UPDATE product SET productName = '6963', productDescription = '', productCatId = '5', productBuyPrice = '180.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06963',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '180',lastbuyprice_withDiscount = '180',meanbuyprice = '180',meanbuyprice_withDiscount = '180' , productbuypricereal = '180.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='180',meanbuyprice_withTax='180',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='180'  WHERE productId = '15866';
UPDATE buybilldetail SET  lastbuyprice = 180 , meanbuyprice = 180, lastbuyprice_withDiscount = 180, meanbuyprice_withDiscount = 180
        , lastbuyprice_withTax = 180, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 180
                where buybilldetailid = 31354;
UPDATE productunit SET proUnitBuyPrice  = 180 * productnumber WHERE productid = 15866;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15865';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15866', '1', '15', '0', '13618', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:46:17','0','0');
UPDATE supplier SET  suppliercurrentDebt = '222405',suppliercurrentDebtInCurrency= '222405' , userid = '77', supplierdate = '2024-11-05 16:47:11'   WHERE supplierid = '102';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('102', '215805.00', '6600', '0', 'اضافة فاتورة مشتريات', '13618', '222405', '2024-11-05 16:46:17', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','6600','1','215805','6600','222405','0');
update buybill set dailyentryid='0,' where buybillid=13618;
COMMIT;
UPDATE product SET overAllAveragePrice = 130 WHERE productId = 15642;UPDATE product SET overAllAveragePrice = 180 WHERE productId = 15866;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:17:12";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:47:12", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:47:12', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13618');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:17:16";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:47:16", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 16:47:16', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13618&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:17:41";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:47:41", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 16:47:41', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13618&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:17:44";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:47:44", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:47:44', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('R3282','','1','410','480', '480','480', '2024-11-05', '0', '77', '1', 'R3282', '0', '0', '0', '0', '0', '410','410','410','410','410','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','410','410','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15867, 1,'2024-11-05 16:48:27',77)
                ON DUPLICATE KEY UPDATE productid = 15867, edited = 1, sysdate = '2024-11-05 16:48:27', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15867', '1', '2024-11-05', '77', '0','1586701','480','480','480','410','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15867', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15867', '1', '0', '0', '15867', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('R3283','','1','245','300', '300','300', '2024-11-05', '0', '77', '1', 'R3283', '0', '0', '0', '0', '0', '245','245','245','245','245','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','245','245','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15868, 1,'2024-11-05 16:49:13',77)
                ON DUPLICATE KEY UPDATE productid = 15868, edited = 1, sysdate = '2024-11-05 16:49:13', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15868', '1', '2024-11-05', '77', '0','1586801','300','300','300','245','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15868', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15868', '1', '0', '0', '15868', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:19:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:49:25", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:49:25', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2fe83ef40
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(398,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:47:04', '0672a2fe83ef40', '398', '0.00', '631', '0', '1', '631.00', '631', '0', '631', '1', '2024-11-05 16:49:25', '', '75', '0', 'سندس احمد K1120', '2', '1', '3', '79', 'سندس احمد K1120', '4' ,'0','','','','','-1','0','0','0','0','0','631','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '631', userid = '75' WHERE clientid = '398';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('398','0.00','631','0','اضافة فاتورة مبيعات','143294', '631', '2024-11-05 16:49:25', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '631', '0', null, '0', null, null,'', '0','1','1','631','1','2024-11-05 16:47:04','0','0');
UPDATE client SET  inUse = 0 where clientid = 398;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','0K769', '143294', '7', '14905', '1', '150', '150', '0', '', '1', '2024-11-05 16:49:25', '14905', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        
                where sellbilldetailid = 523782;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14905, '2024-11-05', 150, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 16:49:25' WHERE storedetailid = '14904';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14905', '1', '1', '1', '143294', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 16:49:25','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06322', '143294', '5', '14466', '1', '455', '455', '0', '', '1', '2024-11-05 16:49:26', '14466', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','455','455','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 523783;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14466, '2024-11-05', 455, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 455, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 16:49:26' WHERE storedetailid = '14465';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14466', '1', '1', '1', '143294', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 16:49:26','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143294', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:49:26', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143294', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-05 16:49:26', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 398;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 631, 630, 630
                    , 630, 630, 630, 630
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+631, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+630
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+630, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+630
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+630
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (398, '2024-11-05', 631, 630, 630
                    , 630, 630, 630, 630
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+631, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+630
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+630, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+630
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+630
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 631, 630, 630
                    , 630, 630, 630, 630, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+631, netSellCostBuyPrice = netSellCostBuyPrice+630
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+630
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+630
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+630
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+630
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+630
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2fe83ef40 and sellbillId = 143294 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:19:26";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:49:26", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:49:26', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6961','','5','170','230', '230','230', '2024-11-05', '0', '77', '1', '06961', '0', '0', '0', '0', '0', '170','170','170','170','170','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','170','170','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15869, 1,'2024-11-05 16:49:47',77)
                ON DUPLICATE KEY UPDATE productid = 15869, edited = 1, sysdate = '2024-11-05 16:49:47', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15869', '1', '2024-11-05', '77', '0','1586901','230','230','230','170','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15869', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15869', '1', '0', '0', '15869', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6962','','5','190','240', '240','240', '2024-11-05', '0', '77', '1', '41186', '0', '0', '0', '0', '0', '190','190','190','190','190','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','190','190','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15870, 1,'2024-11-05 16:50:22',77)
                ON DUPLICATE KEY UPDATE productid = 15870, edited = 1, sysdate = '2024-11-05 16:50:22', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15870', '1', '2024-11-05', '77', '0','1587001','240','240','240','190','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15870', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15870', '1', '0', '0', '15870', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6964','','5','190','240', '240','240', '2024-11-05', '0', '77', '1', '06964', '0', '0', '0', '0', '0', '190','190','190','190','190','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','190','190','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15871, 1,'2024-11-05 16:50:41',77)
                ON DUPLICATE KEY UPDATE productid = 15871, edited = 1, sysdate = '2024-11-05 16:50:41', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15871', '1', '2024-11-05', '77', '0','1587101','240','240','240','190','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15871', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15871', '1', '0', '0', '15871', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:20:52";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:50:52", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:50:52', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a3010a983d', '2024-11-05 16:47:44', '175', '279735.00', '335410', '0', '0', '55675',  '55675', '0', '55675', '1', '2024-11-05 16:50:52', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3245', '13619', '1', '15677', '45', '495', '22275', '0', '', '2024-11-05 16:50:52', '15677','','','0','0','0','0','0',null,'495','22275','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15677, 0, 0
                    , 495, 45, 0, 0, 77, '2024-11-05 16:50:52')
                ON DUPLICATE KEY UPDATE buyprice = 495,
                        buyQuantity =buyQuantity+45, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:52' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15677', '495', '45', '0', 'buyBillController.php', '31355', '', '0', '0');
UPDATE product SET  productBuyPrice = "495" WHERE productId = 15677 ;
UPDATE buybilldetail SET  quantitybefore = -3 WHERE buybilldetailid = 31355 ;
UPDATE product SET productName = 'R3245', productDescription = '', productCatId = '1', productBuyPrice = '495.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3245',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '495',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '495.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='495',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='495',meanbuyprice_withTax='495',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='495'  WHERE productId = '15677';
UPDATE buybilldetail SET  lastbuyprice = 495 , meanbuyprice = 495, lastbuyprice_withDiscount = 495, meanbuyprice_withDiscount = 495
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where buybilldetailid = 31355;
UPDATE productunit SET proUnitBuyPrice  = 495 * productnumber WHERE productid = 15677;
UPDATE storedetail SET  productquantity = '42', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15677', '1', '45', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-3', '42', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3282', '13619', '1', '15867', '20', '410', '8200', '0', '', '2024-11-05 16:50:52', '15867','','','0','0','0','0','0',null,'410','8200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15867, 0, 0
                    , 410, 20, 0, 0, 77, '2024-11-05 16:50:52')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:52' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15867', '410', '20', '0', 'buyBillController.php', '31356', '', '0', '0');
UPDATE product SET  productBuyPrice = "410" WHERE productId = 15867 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31356 ;
UPDATE product SET productName = 'R3282', productDescription = '', productCatId = '1', productBuyPrice = '410.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3282',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410'  WHERE productId = '15867';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 31356;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 15867;
UPDATE storedetail SET  productquantity = '20', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15866';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15867', '1', '20', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06922', '13619', '5', '15789', '15', '245', '3675', '0', '', '2024-11-05 16:50:52', '15789','','','0','0','0','0','0',null,'245','3675','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15789, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:50:52')
                ON DUPLICATE KEY UPDATE buyprice = 245,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:52' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15789', '245', '15', '0', 'buyBillController.php', '31357', '', '0', '0');
UPDATE product SET  productBuyPrice = "245" WHERE productId = 15789 ;
UPDATE buybilldetail SET  quantitybefore = 14 WHERE buybilldetailid = 31357 ;
UPDATE product SET productName = '6922', productDescription = '', productCatId = '5', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06922',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '245',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='245'  WHERE productId = '15789';
UPDATE buybilldetail SET  lastbuyprice = 245 , meanbuyprice = 245, lastbuyprice_withDiscount = 245, meanbuyprice_withDiscount = 245
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where buybilldetailid = 31357;
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15789;
UPDATE storedetail SET  productquantity = '29', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15789', '1', '15', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '14', '29', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06920', '13619', '5', '15788', '15', '245', '3675', '0', '', '2024-11-05 16:50:52', '15788','','','0','0','0','0','0',null,'245','3675','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15788, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:50:52')
                ON DUPLICATE KEY UPDATE buyprice = 245,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:52' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15788', '245', '15', '0', 'buyBillController.php', '31358', '', '0', '0');
UPDATE product SET  productBuyPrice = "245" WHERE productId = 15788 ;
UPDATE buybilldetail SET  quantitybefore = 13 WHERE buybilldetailid = 31358 ;
UPDATE product SET productName = '6920', productDescription = '', productCatId = '5', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06920',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '245',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='245'  WHERE productId = '15788';
UPDATE buybilldetail SET  lastbuyprice = 245 , meanbuyprice = 245, lastbuyprice_withDiscount = 245, meanbuyprice_withDiscount = 245
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where buybilldetailid = 31358;
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15788;
UPDATE storedetail SET  productquantity = '28', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15787';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15788', '1', '15', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '13', '28', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3283', '13619', '1', '15868', '15', '245', '3675', '0', '', '2024-11-05 16:50:52', '15868','','','0','0','0','0','0',null,'245','3675','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15868, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:50:52')
                ON DUPLICATE KEY UPDATE buyprice = 245,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:52' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15868', '245', '15', '0', 'buyBillController.php', '31359', '', '0', '0');
UPDATE product SET  productBuyPrice = "245" WHERE productId = 15868 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31359 ;
UPDATE product SET productName = 'R3283', productDescription = '', productCatId = '1', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3283',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '245',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='245'  WHERE productId = '15868';
UPDATE buybilldetail SET  lastbuyprice = 245 , meanbuyprice = 245, lastbuyprice_withDiscount = 245, meanbuyprice_withDiscount = 245
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where buybilldetailid = 31359;
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15868;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15868', '1', '15', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06921', '13619', '5', '15791', '15', '235', '3525', '0', '', '2024-11-05 16:50:52', '15791','','','0','0','0','0','0',null,'235','3525','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15791, 0, 0
                    , 235, 15, 0, 0, 77, '2024-11-05 16:50:52')
                ON DUPLICATE KEY UPDATE buyprice = 235,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:52' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15791', '235', '15', '0', 'buyBillController.php', '31360', '', '0', '0');
UPDATE product SET  productBuyPrice = "235" WHERE productId = 15791 ;
UPDATE buybilldetail SET  quantitybefore = 12 WHERE buybilldetailid = 31360 ;
UPDATE product SET productName = '6921', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06921',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='235',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15791';
UPDATE buybilldetail SET  lastbuyprice = 235 , meanbuyprice = 235, lastbuyprice_withDiscount = 235, meanbuyprice_withDiscount = 235
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where buybilldetailid = 31360;
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 15791;
UPDATE storedetail SET  productquantity = '27', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15790';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15791', '1', '15', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '12', '27', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06961', '13619', '5', '15869', '15', '170', '2550', '0', '', '2024-11-05 16:50:52', '15869','','','0','0','0','0','0',null,'170','2550','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15869, 0, 0
                    , 170, 15, 0, 0, 77, '2024-11-05 16:50:52')
                ON DUPLICATE KEY UPDATE buyprice = 170,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:52' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15869', '170', '15', '0', 'buyBillController.php', '31361', '', '0', '0');
UPDATE product SET  productBuyPrice = "170" WHERE productId = 15869 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31361 ;
UPDATE product SET productName = '6961', productDescription = '', productCatId = '5', productBuyPrice = '170.00', productSellAllPrice = '230.00', productSellUnitPrice = '230.00', productSellHalfPrice = '230.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06961',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '170',lastbuyprice_withDiscount = '170',meanbuyprice = '170',meanbuyprice_withDiscount = '170' , productbuypricereal = '170.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='170',meanbuyprice_withTax='170',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='170'  WHERE productId = '15869';
UPDATE buybilldetail SET  lastbuyprice = 170 , meanbuyprice = 170, lastbuyprice_withDiscount = 170, meanbuyprice_withDiscount = 170
        , lastbuyprice_withTax = 170, meanbuyprice_withTax = 170, lastbuyprice_withDiscountAndTax = 170
                where buybilldetailid = 31361;
UPDATE productunit SET proUnitBuyPrice  = 170 * productnumber WHERE productid = 15869;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15869', '1', '15', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06880', '13619', '5', '15692', '10', '240', '2400', '0', '', '2024-11-05 16:50:52', '15692','','','0','0','0','0','0',null,'240','2400','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15692, 0, 0
                    , 240, 10, 0, 0, 77, '2024-11-05 16:50:53')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:53' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15692', '240', '10', '0', 'buyBillController.php', '31362', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15692 ;
UPDATE buybilldetail SET  quantitybefore = 25 WHERE buybilldetailid = 31362 ;
UPDATE product SET productName = '6880', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '06880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15692';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 240, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 240
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31362;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15692;
UPDATE storedetail SET  productquantity = '35', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '10', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '25', '35', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('41186', '13619', '5', '15870', '15', '190', '2850', '0', '', '2024-11-05 16:50:52', '15870','','','0','0','0','0','0',null,'190','2850','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15870, 0, 0
                    , 190, 15, 0, 0, 77, '2024-11-05 16:50:53')
                ON DUPLICATE KEY UPDATE buyprice = 190,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:53' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15870', '190', '15', '0', 'buyBillController.php', '31363', '', '0', '0');
UPDATE product SET  productBuyPrice = "190" WHERE productId = 15870 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31363 ;
UPDATE product SET productName = '6962', productDescription = '', productCatId = '5', productBuyPrice = '190.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '41186',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '190',meanbuyprice = '190',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='190',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='190'  WHERE productId = '15870';
UPDATE buybilldetail SET  lastbuyprice = 190 , meanbuyprice = 190, lastbuyprice_withDiscount = 190, meanbuyprice_withDiscount = 190
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where buybilldetailid = 31363;
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 15870;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15869';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15870', '1', '15', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06964', '13619', '5', '15871', '15', '190', '2850', '0', '', '2024-11-05 16:50:52', '15871','','','0','0','0','0','0',null,'190','2850','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15871, 0, 0
                    , 190, 15, 0, 0, 77, '2024-11-05 16:50:53')
                ON DUPLICATE KEY UPDATE buyprice = 190,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:50:53' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15871', '190', '15', '0', 'buyBillController.php', '31364', '', '0', '0');
UPDATE product SET  productBuyPrice = "190" WHERE productId = 15871 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31364 ;
UPDATE product SET productName = '6964', productDescription = '', productCatId = '5', productBuyPrice = '190.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06964',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '190',meanbuyprice = '190',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='190',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='190'  WHERE productId = '15871';
UPDATE buybilldetail SET  lastbuyprice = 190 , meanbuyprice = 190, lastbuyprice_withDiscount = 190, meanbuyprice_withDiscount = 190
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where buybilldetailid = 31364;
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 15871;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15870';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15871', '1', '15', '0', '13619', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:47:44','0','0');
UPDATE supplier SET  suppliercurrentDebt = '335410',suppliercurrentDebtInCurrency= '335410' , userid = '77', supplierdate = '2024-11-05 16:50:52'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '279735.00', '55675', '0', 'اضافة فاتورة مشتريات', '13619', '335410', '2024-11-05 16:47:44', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','55675','1','279735','55675','335410','0');
update buybill set dailyentryid='0,' where buybillid=13619;
COMMIT;
UPDATE product SET overAllAveragePrice = 495 WHERE productId = 15677;UPDATE product SET overAllAveragePrice = 240 WHERE productId = 15692;UPDATE product SET overAllAveragePrice = 245 WHERE productId = 15788;UPDATE product SET overAllAveragePrice = 245 WHERE productId = 15789;UPDATE product SET overAllAveragePrice = 235 WHERE productId = 15791;UPDATE product SET overAllAveragePrice = 410 WHERE productId = 15867;UPDATE product SET overAllAveragePrice = 245 WHERE productId = 15868;UPDATE product SET overAllAveragePrice = 170 WHERE productId = 15869;UPDATE product SET overAllAveragePrice = 190 WHERE productId = 15870;UPDATE product SET overAllAveragePrice = 190 WHERE productId = 15871;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:20:53";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:50:53", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:50:53', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13619');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:21:17";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:51:17", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:51:17', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:21:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:51:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:51:23', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13619');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:21:50";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:51:50", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:51:50', '77', 'update', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=update');
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 13619;
UPDATE buybill SET  buybillsysdate = '2024-11-05 16:51:50', userid = '77',delbyuserid = '77', conditions = '1' WHERE buybillid = '13619';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15677, 0, 0
                    , 495, 45, 0, 0, 77, '2024-11-05 16:51:50')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-45, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:50' ;
UPDATE product SET productName = 'R3245', productDescription = '', productCatId = '1', productBuyPrice = '495.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3245',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '495',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '495.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='495',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='495',meanbuyprice_withTax='495',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15677';
UPDATE productunit SET proUnitBuyPrice  = 495 * productnumber WHERE productid = 15677;
UPDATE storedetail SET  productquantity = '-3', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15677', '1', '45', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '42', '-3', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15867, 0, 0
                    , 410, 20, 0, 0, 77, '2024-11-05 16:51:50')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:50' ;
UPDATE buybilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410.00, meanbuyprice_withTax = 410.00, lastbuyprice_withDiscountAndTax = 410.00
                where buybilldetailid = 31356;
UPDATE product SET productName = 'R3282', productDescription = '', productCatId = '1', productBuyPrice = '410.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3282',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '0',meanbuyprice = '410.00',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15867';
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 15867;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15866';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15867', '1', '20', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '20', '0', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15789, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:51:50')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:50' ;
UPDATE product SET productName = '6922', productDescription = '', productCatId = '5', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06922',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '245',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15789';
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15789;
UPDATE storedetail SET  productquantity = '14', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15789', '1', '15', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '29', '14', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15788, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:51:50')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:50' ;
UPDATE product SET productName = '6920', productDescription = '', productCatId = '5', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06920',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '245',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15788';
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15788;
UPDATE storedetail SET  productquantity = '13', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15787';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15788', '1', '15', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '28', '13', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15868, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:51:50')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:50' ;
UPDATE buybilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245.00, meanbuyprice_withTax = 245.00, lastbuyprice_withDiscountAndTax = 245.00
                where buybilldetailid = 31359;
UPDATE product SET productName = 'R3283', productDescription = '', productCatId = '1', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3283',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '0',meanbuyprice = '245.00',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15868';
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15868;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15868', '1', '15', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15791, 0, 0
                    , 235, 15, 0, 0, 77, '2024-11-05 16:51:50')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:50' ;
UPDATE product SET productName = '6921', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06921',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='235',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15791';
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 15791;
UPDATE storedetail SET  productquantity = '12', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15790';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15791', '1', '15', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '27', '12', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15869, 0, 0
                    , 170, 15, 0, 0, 77, '2024-11-05 16:51:50')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:50' ;
UPDATE buybilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        , lastbuyprice_withTax = 170.00, meanbuyprice_withTax = 170.00, lastbuyprice_withDiscountAndTax = 170.00
                where buybilldetailid = 31361;
UPDATE product SET productName = '6961', productDescription = '', productCatId = '5', productBuyPrice = '170.00', productSellAllPrice = '230.00', productSellUnitPrice = '230.00', productSellHalfPrice = '230.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06961',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '170',lastbuyprice_withDiscount = '0',meanbuyprice = '170.00',meanbuyprice_withDiscount = '170' , productbuypricereal = '170.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='170',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='170',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15869';
UPDATE productunit SET proUnitBuyPrice  = 170 * productnumber WHERE productid = 15869;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15869', '1', '15', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15692, 0, 0
                    , 240, 10, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET productName = '6880', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '06880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15692';
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15692;
UPDATE storedetail SET  productquantity = '25', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '10', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '35', '25', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15870, 0, 0
                    , 190, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE buybilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190.00, meanbuyprice_withTax = 190.00, lastbuyprice_withDiscountAndTax = 190.00
                where buybilldetailid = 31363;
UPDATE product SET productName = '6962', productDescription = '', productCatId = '5', productBuyPrice = '190.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '41186',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '0',meanbuyprice = '190.00',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='190',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15870';
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 15870;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15869';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15870', '1', '15', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-11-05 16:47:44','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:47:44', 1, 15871, 0, 0
                    , 190, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE buybilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190.00, meanbuyprice_withTax = 190.00, lastbuyprice_withDiscountAndTax = 190.00
                where buybilldetailid = 31364;
UPDATE product SET productName = '6964', productDescription = '', productCatId = '5', productBuyPrice = '190.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06964',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '0',meanbuyprice = '190.00',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='190',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15871';
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 15871;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15870';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15871', '1', '15', '1', '13619', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-11-05 16:47:44','0','0');
UPDATE supplier SET  suppliercurrentDebt = '279735',suppliercurrentDebtInCurrency= '279735' , userid = '77', supplierdate = '2024-11-05 16:51:50'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '335410.00', '55675.00', '1', 'حذف فاتورة مشتريات - للتعديل', '13619', '279735', '2024-11-05 16:47:44', '77', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','55675','1','335410','55675','279735','0');
UPDATE productserial SET del = 1
		 WHERE billid = 13619;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a3010a983d', '2024-11-05 16:50:52', '175', '279735.00', '332865', '0', '0', '53130', '53130', '0.00', '53130', '1', '2024-11-05 16:51:50', '', '77', '0', '', '1', '1','1','13619','buyBillController.php','0.00','-1','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3245', '13620', '1', '15677', '44', '495', '21780', '0.00', '', '2024-11-05 16:51:50', '15677','','','0','0','0','0','0',null,'495','21780','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15677, 0, 0
                    , 495, 44, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 495,
                        buyQuantity =buyQuantity+44, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "495" WHERE productId = 15677 ;
UPDATE buybilldetail SET  quantitybefore = -3 WHERE buybilldetailid = 31365 ;
UPDATE product SET productName = 'R3245', productDescription = '', productCatId = '1', productBuyPrice = '495.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3245',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '495',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '495.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='495',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='495',meanbuyprice_withTax='495',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='495'  WHERE productId = '15677';
UPDATE buybilldetail SET  lastbuyprice = 495 , meanbuyprice = 495, lastbuyprice_withDiscount = 495, meanbuyprice_withDiscount = 495
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where buybilldetailid = 31365;
UPDATE productunit SET proUnitBuyPrice  = 495 * productnumber WHERE productid = 15677;
UPDATE storedetail SET  productquantity = '41', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15677', '1', '44', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-3', '41', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3282', '13620', '1', '15867', '15', '410', '6150', '0.00', '', '2024-11-05 16:51:50', '15867','','','0','0','0','0','0',null,'410','6150','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15867, 0, 0
                    , 410, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "410" WHERE productId = 15867 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31366 ;
UPDATE product SET productName = 'R3282', productDescription = '', productCatId = '1', productBuyPrice = '410.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3282',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='176',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410'  WHERE productId = '15867';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 176, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 31366;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 15867;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15866';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15867', '1', '15', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06922', '13620', '5', '15789', '15.00', '245', '3675', '0.00', '', '2024-11-05 16:51:50', '15789','','','0','0','0','0','0',null,'245','3675','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15789, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 245,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "245" WHERE productId = 15789 ;
UPDATE buybilldetail SET  quantitybefore = 14 WHERE buybilldetailid = 31367 ;
UPDATE product SET productName = '6922', productDescription = '', productCatId = '5', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06922',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '245',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='245'  WHERE productId = '15789';
UPDATE buybilldetail SET  lastbuyprice = 245 , meanbuyprice = 245, lastbuyprice_withDiscount = 245, meanbuyprice_withDiscount = 245
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where buybilldetailid = 31367;
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15789;
UPDATE storedetail SET  productquantity = '29', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15789', '1', '15', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '14', '29', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06920', '13620', '5', '15788', '15.00', '245', '3675', '0.00', '', '2024-11-05 16:51:50', '15788','','','0','0','0','0','0',null,'245','3675','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15788, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 245,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "245" WHERE productId = 15788 ;
UPDATE buybilldetail SET  quantitybefore = 13 WHERE buybilldetailid = 31368 ;
UPDATE product SET productName = '6920', productDescription = '', productCatId = '5', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06920',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '245',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='245',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='245'  WHERE productId = '15788';
UPDATE buybilldetail SET  lastbuyprice = 245 , meanbuyprice = 245, lastbuyprice_withDiscount = 245, meanbuyprice_withDiscount = 245
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where buybilldetailid = 31368;
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15788;
UPDATE storedetail SET  productquantity = '28', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15787';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15788', '1', '15', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '13', '28', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3283', '13620', '1', '15868', '15.00', '245', '3675', '0.00', '', '2024-11-05 16:51:50', '15868','','','0','0','0','0','0',null,'245','3675','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15868, 0, 0
                    , 245, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 245,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "245" WHERE productId = 15868 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31369 ;
UPDATE product SET productName = 'R3283', productDescription = '', productCatId = '1', productBuyPrice = '245.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3283',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '245',lastbuyprice_withDiscount = '245',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '245.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='245',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='245',meanbuyprice_withTax='123',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='245'  WHERE productId = '15868';
UPDATE buybilldetail SET  lastbuyprice = 245 , meanbuyprice = 245, lastbuyprice_withDiscount = 245, meanbuyprice_withDiscount = 245
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 123, lastbuyprice_withDiscountAndTax = 245
                where buybilldetailid = 31369;
UPDATE productunit SET proUnitBuyPrice  = 245 * productnumber WHERE productid = 15868;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15868', '1', '15', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06921', '13620', '5', '15791', '15.00', '235', '3525', '0.00', '', '2024-11-05 16:51:50', '15791','','','0','0','0','0','0',null,'235','3525','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15791, 0, 0
                    , 235, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 235,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "235" WHERE productId = 15791 ;
UPDATE buybilldetail SET  quantitybefore = 12 WHERE buybilldetailid = 31370 ;
UPDATE product SET productName = '6921', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06921',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='235',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15791';
UPDATE buybilldetail SET  lastbuyprice = 235 , meanbuyprice = 235, lastbuyprice_withDiscount = 235, meanbuyprice_withDiscount = 235
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where buybilldetailid = 31370;
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 15791;
UPDATE storedetail SET  productquantity = '27', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15790';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15791', '1', '15', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '12', '27', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06961', '13620', '5', '15869', '15.00', '170', '2550', '0.00', '', '2024-11-05 16:51:50', '15869','','','0','0','0','0','0',null,'170','2550','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15869, 0, 0
                    , 170, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 170,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "170" WHERE productId = 15869 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31371 ;
UPDATE product SET productName = '6961', productDescription = '', productCatId = '5', productBuyPrice = '170.00', productSellAllPrice = '230.00', productSellUnitPrice = '230.00', productSellHalfPrice = '230.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06961',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '170',lastbuyprice_withDiscount = '170',meanbuyprice = '170',meanbuyprice_withDiscount = '170' , productbuypricereal = '170.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='170',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='170',meanbuyprice_withTax='85',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='170'  WHERE productId = '15869';
UPDATE buybilldetail SET  lastbuyprice = 170 , meanbuyprice = 170, lastbuyprice_withDiscount = 170, meanbuyprice_withDiscount = 170
        , lastbuyprice_withTax = 170, meanbuyprice_withTax = 85, lastbuyprice_withDiscountAndTax = 170
                where buybilldetailid = 31371;
UPDATE productunit SET proUnitBuyPrice  = 170 * productnumber WHERE productid = 15869;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15869', '1', '15', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06880', '13620', '5', '15692', '10.00', '240', '2400', '0.00', '', '2024-11-05 16:51:50', '15692','','','0','0','0','0','0',null,'240','2400','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15692, 0, 0
                    , 240, 10, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15692 ;
UPDATE buybilldetail SET  quantitybefore = 25 WHERE buybilldetailid = 31372 ;
UPDATE product SET productName = '6880', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '06880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15692';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 240, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 240
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31372;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15692;
UPDATE storedetail SET  productquantity = '35', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '10', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '25', '35', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('41186', '13620', '5', '15870', '15.00', '190', '2850', '0.00', '', '2024-11-05 16:51:50', '15870','','','0','0','0','0','0',null,'190','2850','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15870, 0, 0
                    , 190, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 190,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "190" WHERE productId = 15870 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31373 ;
UPDATE product SET productName = '6962', productDescription = '', productCatId = '5', productBuyPrice = '190.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '41186',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '190',meanbuyprice = '190',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='190',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='95',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='190'  WHERE productId = '15870';
UPDATE buybilldetail SET  lastbuyprice = 190 , meanbuyprice = 190, lastbuyprice_withDiscount = 190, meanbuyprice_withDiscount = 190
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 95, lastbuyprice_withDiscountAndTax = 190
                where buybilldetailid = 31373;
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 15870;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15869';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15870', '1', '15', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:50:52','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06964', '13620', '5', '15871', '15.00', '190', '2850', '0.00', '', '2024-11-05 16:51:50', '15871','','','0','0','0','0','0',null,'190','2850','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:50:52', 1, 15871, 0, 0
                    , 190, 15, 0, 0, 77, '2024-11-05 16:51:51')
                ON DUPLICATE KEY UPDATE buyprice = 190,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:51:51' ;
UPDATE product SET  productBuyPrice = "190" WHERE productId = 15871 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31374 ;
UPDATE product SET productName = '6964', productDescription = '', productCatId = '5', productBuyPrice = '190.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06964',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '190',meanbuyprice = '190',meanbuyprice_withDiscount = '190' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='190',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='95',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='190'  WHERE productId = '15871';
UPDATE buybilldetail SET  lastbuyprice = 190 , meanbuyprice = 190, lastbuyprice_withDiscount = 190, meanbuyprice_withDiscount = 190
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 95, lastbuyprice_withDiscountAndTax = 190
                where buybilldetailid = 31374;
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 15871;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15870';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15871', '1', '15', '0', '13620', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 16:50:52','0','0');
DELETE FROM productserial WHERE billid = 13619
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '332865',suppliercurrentDebtInCurrency= '332865' , userid = '77', supplierdate = '2024-11-05 16:51:50'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '279735.00', '53130', '0', 'اضافة فاتورة مشتريات', '13620', '332865', '2024-11-05 16:51:50', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','55675','1','279735','53130','332865','0');
update buybill set dailyentryid='0,' where buybillid=13620;
UPDATE product SET overAllAveragePrice = 495 WHERE productId = 15677;UPDATE product SET overAllAveragePrice = 240 WHERE productId = 15692;UPDATE product SET overAllAveragePrice = 245 WHERE productId = 15788;UPDATE product SET overAllAveragePrice = 245 WHERE productId = 15789;UPDATE product SET overAllAveragePrice = 235 WHERE productId = 15791;UPDATE product SET overAllAveragePrice = 410 WHERE productId = 15867;UPDATE product SET overAllAveragePrice = 245 WHERE productId = 15868;UPDATE product SET overAllAveragePrice = 170 WHERE productId = 15869;UPDATE product SET overAllAveragePrice = 190 WHERE productId = 15870;UPDATE product SET overAllAveragePrice = 190 WHERE productId = 15871;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:21:51";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:51:51", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:51:51', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13620');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:22:00";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:52:00", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 16:52:00', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13620&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:22:06";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:52:06", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:52:06', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2d0b726e1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9639,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:34:51', '0672a2d0b726e1', '9639', '22.00', '259', '0', '1', '237.00', '237', '0', '237', '1', '2024-11-05 16:52:06', '', '75', '0', 'هنا عرفة e785', '2', '1', '3', '78', 'هنا عرفة e785', '3' ,'0','','','','','-1','0','0','0','0','0','237','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '259', userid = '75' WHERE clientid = '9639';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9639','22.00','237','0','اضافة فاتورة مبيعات','143295', '259', '2024-11-05 16:52:06', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '237', '0', null, '0', null, null,'', '0','1','1','237','1','2024-11-05 16:34:51','0','0');
UPDATE client SET  inUse = 0 where clientid = 9639;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32690;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06454', '143295', '5', '14733', '1', '215', '215', '0', '', '1', '2024-11-05 16:52:06', '14733', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32690-1,','1','1','0','0','215','215','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 163.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 163.00
        
                where sellbilldetailid = 523786;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14733, '2024-11-05', 215, 160, 160
                    , 163, 160, 163, 162.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+163
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+163
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+162.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 215, 160, 160
                    , 163, 160, 163, 162.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+215, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+163
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+163
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+162.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 16:52:06' WHERE storedetailid = '14732';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14733', '1', '1', '1', '143295', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 16:52:06','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143295', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:52:06', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143295', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-05 16:52:06', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 78 where clientid = 9639;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 237, 160, 160
                    , 163, 160, 163, 162.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+237, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+163
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+163
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+162.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9639, '2024-11-05', 237, 160, 160
                    , 163, 160, 163, 162.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+237, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+163
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+163
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+162.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 237, 160, 160
                    , 163, 160, 163, 162.5, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+237, netSellCostBuyPrice = netSellCostBuyPrice+160
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+160
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+163
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+160
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+163
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+162.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2d0b726e1 and sellbillId = 143295 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:22:07";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:52:07", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:52:07', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:22:58";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:52:58", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 16:52:58', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13620&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:23:00";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:53:00", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:53:00', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:23:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:53:24", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:53:24', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3076db689
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2224,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:49:26', '0672a3076db689', '2224', '0.00', '1162', '0', '1', '1162.00', '1162', '0', '1162', '1', '2024-11-05 16:53:24', '', '75', '0', 'ابانوب سامي 73', '2', '1', '3', '79', 'ابانوب سامي 73', '6' ,'0','','','','','-1','0','0','0','0','0','1162','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1162', userid = '75' WHERE clientid = '2224';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2224','0.00','1162','0','اضافة فاتورة مبيعات','143296', '1162', '2024-11-05 16:53:24', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1162', '0', null, '0', null, null,'', '0','1','1','1162','1','2024-11-05 16:49:26','0','0');
UPDATE client SET  inUse = 0 where clientid = 2224;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34528;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('130','06867', '143296', '5', '15642', '1', '210', '210', '0', '', '1', '2024-11-05 16:53:24', '15642', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34528-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 130.00 , meanbuyprice = 130.00, lastbuyprice_withDiscount = 130.00, meanbuyprice_withDiscount = 130.00
        , lastbuyprice_withTax = 130, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 130
                where sellbilldetailid = 523789;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15642, '2024-11-05', 210, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '47', userid = '75', storedetaildate = '2024-11-05 16:53:24' WHERE storedetailid = '15641';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15642', '1', '1', '1', '143296', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '47', '75', '2024-11-05 16:53:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20057;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','0H988', '143296', '14', '9277', '1', '340', '340', '0', '', '1', '2024-11-05 16:53:24', '9277', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20057-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 523790;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9277, '2024-11-05', 340, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 16:53:24' WHERE storedetailid = '9276';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9277', '1', '1', '1', '143296', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 16:53:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34273;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','H1361', '143296', '14', '15492', '1', '320', '320', '0', '', '1', '2024-11-05 16:53:24', '15492', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34273-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 167, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523791;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15492, '2024-11-05', 320, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 167, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+167
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 167, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+167
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 16:53:24' WHERE storedetailid = '15491';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15492', '1', '1', '1', '143296', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 16:53:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26142;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','H1164', '143296', '14', '9924', '1', '260', '260', '0', '', '1', '2024-11-05 16:53:24', '9924', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26142-1,','1','1','0','0','260','260','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 111.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 111.00
        
                where sellbilldetailid = 523792;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9924, '2024-11-05', 260, 145, 145
                    , 111, 145, 111, 142.36
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.36
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 260, 145, 145
                    , 111, 145, 111, 142.36
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+111
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+111
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.36
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '75', storedetaildate = '2024-11-05 16:53:24' WHERE storedetailid = '9923';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9924', '1', '1', '1', '143296', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '75', '2024-11-05 16:53:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143296', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:53:24', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143296', '17', '10291', '1', '12', '12', '0', '', '1', '2024-11-05 16:53:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','12','12','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 2224;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1162, 765, 765
                    , 731, 765, 731, 762.36
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,380, 297, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1162, sellCostBuyPrice =sellCostBuyPrice+765
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+765, sellCostMeanBuyPrice = sellCostMeanBuyPrice+731
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+765, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+731
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+762.36
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+297
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2224, '2024-11-05', 1162, 765, 765
                    , 731, 765, 731, 762.36
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,380, 297, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1162, sellCostBuyPrice =sellCostBuyPrice+765
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+765, sellCostMeanBuyPrice = sellCostMeanBuyPrice+731
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+765, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+731
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+762.36
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+297
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1162, 765, 765
                    , 731, 765, 731, 762.36, 380, 297)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1162, netSellCostBuyPrice = netSellCostBuyPrice+765
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+765
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+731
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+765
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+731
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+762.36
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+380
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+297;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3076db689 and sellbillId = 143296 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:23:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 16:53:25", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:53:25', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:23:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:53:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:53:28', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2e513d573
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:40:17', '0672a2e513d573', '1', '0.00', '0', '0', '1', '3434.00', '3434', '3434', '0', '1', '2024-11-05 16:53:28', '', '9', '0', 'نقدي', '1', '0', '3', '93', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','3434','0','','0','0','3434','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143297', '0', '2024-11-05 16:53:28', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3434', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:40:17','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33228;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('135','06589', '143297', '5', '15031', '1', '185', '185', '0', '', '1', '2024-11-05 16:53:28', '15031', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33228-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 135.00 , meanbuyprice = 135.00, lastbuyprice_withDiscount = 135.00, meanbuyprice_withDiscount = 135.00
        
                where sellbilldetailid = 523795;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15031, '2024-11-05', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185, 135, 135
                    , 135, 135, 135, 135
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+135
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+135, sellCostMeanBuyPrice = sellCostMeanBuyPrice+135
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+135, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+135
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+135
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 16:53:28' WHERE storedetailid = '15030';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15031', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 16:53:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34642;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06900', '143297', '5', '15715', '1', '300', '300', '0', '', '1', '2024-11-05 16:53:29', '15715', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34642-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 239.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 239.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 238, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523796;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15715, '2024-11-05', 300, 240, 240
                    , 239, 240, 239, 238.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 238, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+239
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+239
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+238
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 239, 240, 239, 238.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 238, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+239
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+239
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+238
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '37', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '15714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15715', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '38', '37', '9', '2024-11-05 16:53:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 23724;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('480','53925', '143297', '5', '10889', '1', '190', '190', '0', '', '1', '2024-11-05 16:53:29', '10889', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','23724-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 1080.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 1080.00
        
                where sellbilldetailid = 523797;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10889, '2024-11-05', 190, 480, 480
                    , 1080, 480, 1080, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 480, 480
                    , 1080, 480, 1080, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '10888';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10889', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-05 16:53:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34389;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','H1304', '143297', '14', '15395', '1', '320', '320', '0', '', '1', '2024-11-05 16:53:29', '15395', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34389-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 76, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523798;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15395, '2024-11-05', 320, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 76, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+76
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 76, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+76
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '15394';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15395', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 16:53:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 18726;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','34488', '143297', '5', '8780', '1', '140', '140', '0', '', '1', '2024-11-05 16:53:29', '8780', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','18726-1,','1','1','0','0','140','140','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        
                where sellbilldetailid = 523799;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8780, '2024-11-05', 140, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 140, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '8779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8780', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '9', '2024-11-05 16:53:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 32482;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06418', '143297', '5', '14618', '2', '165', '330', '0', '', '1', '2024-11-05 16:53:29', '14618', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32482-2,','1','1','0','0','165','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523800;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14618, '2024-11-05', 330, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '14617';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14618', '1', '2', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '1', '9', '2024-11-05 16:53:29','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','04834', '143297', '5', '10445', '1', '280', '280', '0', '', '1', '2024-11-05 16:53:29', '10445', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 450.00
        
                where sellbilldetailid = 523801;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10445, '2024-11-05', 280, 400, 500
                    , 450, 500, 450, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 400, 500
                    , 450, 500, 450, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '10444';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10445', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '9', '2024-11-05 16:53:29','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100','00M21', '143297', '11', '5003', '1', '150', '150', '0', '', '1', '2024-11-05 16:53:29', '5003', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        
                where sellbilldetailid = 523802;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5003, '2024-11-05', 150, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-29', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '5002';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5003', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-28', '-29', '9', '2024-11-05 16:53:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29801;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('290','05982', '143297', '5', '13348', '1', '170', '170', '0', '', '1', '2024-11-05 16:53:29', '13348', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29801-1,','1','1','0','0','170','170','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 290.00 , meanbuyprice = 290.00, lastbuyprice_withDiscount = 290.00, meanbuyprice_withDiscount = 290.00
        
                where sellbilldetailid = 523803;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13348, '2024-11-05', 170, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 170, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '13347';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13348', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 16:53:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34660;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','R3249', '143297', '1', '15731', '1', '300', '300', '0', '', '1', '2024-11-05 16:53:29', '15731', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34660-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523804;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15731, '2024-11-05', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '15730';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15731', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 16:53:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26171;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','05407', '143297', '5', '11779', '1', '295', '295', '0', '', '1', '2024-11-05 16:53:29', '11779', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26171-1,','1','1','0','0','295','295','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        
                where sellbilldetailid = 523805;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11779, '2024-11-05', 295, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 295, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '11778';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11779', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 16:53:29','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('445','05872', '143297', '5', '13115', '1', '385', '385', '0', '', '1', '2024-11-05 16:53:29', '13115', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 455.00 , meanbuyprice = 446.00, lastbuyprice_withDiscount = 455.00, meanbuyprice_withDiscount = 446.00
        
                where sellbilldetailid = 523806;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13115, '2024-11-05', 385, 445, 455
                    , 446, 455, 446, 443
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+443
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 445, 455
                    , 446, 455, 446, 443
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+443
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '13114';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13115', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 16:53:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29054;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','05830', '143297', '5', '12935', '1', '355', '355', '0', '', '1', '2024-11-05 16:53:29', '12935', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29054-1,','1','1','0','0','355','355','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        
                where sellbilldetailid = 523807;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12935, '2024-11-05', 355, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+355, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 355, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+355, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 16:53:29' WHERE storedetailid = '12934';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12935', '1', '1', '1', '143297', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 16:53:29','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143297', '17', '10291', '1', '34', '34', '0', '', '1', '2024-11-05 16:53:29', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','34','34','0','','0','0.00','0','0','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '46584',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('43150','3434', '0', '1', 'اضافة فاتورة مبيعات', '143297', '46584', '2024-11-05 16:53:29', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 93 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 3434, 3965, 4075
                    , 4615, 4075, 4615, 3461.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,735, 559, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3434, sellCostBuyPrice =sellCostBuyPrice+3965
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4615
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4615
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3461.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+735
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+559
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 3434, 3965, 4075
                    , 4615, 4075, 4615, 3461.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,735, 559, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3434, sellCostBuyPrice =sellCostBuyPrice+3965
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4615
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4615
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3461.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+735
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+559
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3434, 3965, 4075
                    , 4615, 4075, 4615, 3461.33, 735, 559)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3434, netSellCostBuyPrice = netSellCostBuyPrice+3965
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4075
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4615
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4075
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4615
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3461.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+735
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+559;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2e513d573 and sellbillId = 143297 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:23:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:53:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:53:30', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:24:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:54:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:54:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:25:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:55:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:55:58', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a319ba0d7c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 16:54:19', '0672a319ba0d7c', '1', '0.00', '0', '10', '1', '470', '460', '-460', '0', '1', '2024-11-05 16:55:58', '', '9', '0', 'نقدي','1', '0', '5', '26', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-460','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16233', '0', '2024-11-05 16:55:58', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '460', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:54:19','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('330.00', 'H1422', '16233', '14', '15710', '1', '470', '470', '0', '', '1', '0', '15710', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','470','470','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where returnsellbilldetailid = 21273;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15710, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 480, 330, 330, 330
                    , 330, 330, 330, 0, 1, 0, 0, 330, 330)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+480, returnSellCostBuyPrice = returnSellCostBuyPrice+330, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+330
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+330, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+330
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+330
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+330
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+330
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+330
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 480, 330, 330, 330
                    , 330, 330, 330, 0, 0, 330, 330)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+480, returnSellCostBuyPrice = returnSellCostBuyPrice+330, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+330
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+330, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+330
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+330
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+330
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+330
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+330;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 16:55:59' WHERE storedetailid = '15709';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15710', '1', '1', '0', '16233', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '12', '13', '9', '2024-11-05 16:55:59','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '46124',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46584','-460', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16233', '46124', '2024-11-05 16:55:59', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 460, 330, 330, 330
                    , 330, 330, 330 ,0, 0, 330, 330)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+460, returnSellCostBuyPrice = returnSellCostBuyPrice+330, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+330
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+330, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+330
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+330
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+330
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+330
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+330;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 460, 330, 330, 330
                    , 330, 330, 330 ,0, 0, 330, 330)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+460, returnSellCostBuyPrice = returnSellCostBuyPrice+330, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+330
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+330, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+330
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+330
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+330
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+330
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+330;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -460, -330, -330
                    , -330, -330, -330, -330, -330, -330)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-460, netSellCostBuyPrice = netSellCostBuyPrice+-330
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-330
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-330
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-330
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-330;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a319ba0d7c and sellbillId = 16233 and returnsellbillId = 16233
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:25:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:55:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:55:59', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1466','','14','455','550', '550','550', '2024-11-05', '0', '77', '1', 'H1466', '0', '0', '0', '0', '0', '455','455','455','455','455','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','455','455','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15872, 1,'2024-11-05 16:56:06',77)
                ON DUPLICATE KEY UPDATE productid = 15872, edited = 1, sysdate = '2024-11-05 16:56:06', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15872', '1', '2024-11-05', '77', '0','1587201','550','550','550','455','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15872', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15872', '1', '0', '0', '15872', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:26:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:56:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:56:13', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a316a67260
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:53:30', '0672a316a67260', '1', '0.00', '0', '40', '1', '1750.00', '1710', '1710', '0', '1', '2024-11-05 16:56:13', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1710','0','','0','0','1710','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143298', '0', '2024-11-05 16:56:13', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1710', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:53:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34367;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3235', '143298', '1', '15538', '1', '300', '300', '0', '', '1', '2024-11-05 16:56:13', '15538', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34367-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 208, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523809;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15538, '2024-11-05', 293.14285714286, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+293.14285714286, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 293.14285714286, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+293.14285714286, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-05 16:56:13' WHERE storedetailid = '15537';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15538', '1', '1', '1', '143298', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-05 16:56:13','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34750;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1443', '143298', '14', '15775', '1', '620', '620', '0', '', '1', '2024-11-05 16:56:13', '15775', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34750-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 523810;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15775, '2024-11-05', 605.82857142857, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+605.82857142857, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 605.82857142857, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+605.82857142857, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 16:56:13' WHERE storedetailid = '15774';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15775', '1', '1', '1', '143298', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 16:56:13','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34710;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06903', '143298', '5', '15753', '1', '320', '320', '0', '', '1', '2024-11-05 16:56:13', '15753', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34710-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523811;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15753, '2024-11-05', 312.68571428571, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+312.68571428571, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 312.68571428571, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+312.68571428571, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-05 16:56:13' WHERE storedetailid = '15752';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15753', '1', '1', '1', '143298', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-05 16:56:13','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34639;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1425', '143298', '14', '15712', '1', '510', '510', '0', '', '1', '2024-11-05 16:56:13', '15712', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34639-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523812;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15712, '2024-11-05', 498.34285714286, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+498.34285714286, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 498.34285714286, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+498.34285714286, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-05 16:56:13' WHERE storedetailid = '15711';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15712', '1', '1', '1', '143298', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-05 16:56:13','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '47834',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46124','1710', '0', '1', 'اضافة فاتورة مبيعات', '143298', '47834', '2024-11-05 16:56:13', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1710, 1420, 1420
                    , 1420, 1420, 1420, 1420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1420, 1378, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1710, sellCostBuyPrice =sellCostBuyPrice+1420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1378
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1710, 1420, 1420
                    , 1420, 1420, 1420, 1420
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1420, 1378, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1710, sellCostBuyPrice =sellCostBuyPrice+1420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1378
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1710, 1420, 1420
                    , 1420, 1420, 1420, 1420, 1420, 1378)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1710, netSellCostBuyPrice = netSellCostBuyPrice+1420
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1420
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1420
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1420
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1420
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1420
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1420
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1378;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a316a67260 and sellbillId = 143298 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:26:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:56:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:56:13', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:26:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:56:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:56:36', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:27:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:57:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:57:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3224351fa
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:56:36', '0672a3224351fa', '1', '0.00', '0', '0', '1', '420.00', '420', '420', '0', '1', '2024-11-05 16:57:08', '', '9', '0', 'نقدي', '1', '0', '3', '21', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','420','0','','0','0','420','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143299', '0', '2024-11-05 16:57:08', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '420', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:56:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34467;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06836', '143299', '5', '15557', '1', '420', '420', '0', '', '1', '2024-11-05 16:57:08', '15557', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34467-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 194, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 523813;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15557, '2024-11-05', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-05 16:57:08' WHERE storedetailid = '15556';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15557', '1', '1', '1', '143299', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-05 16:57:08','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '48254',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('47834','420', '0', '1', 'اضافة فاتورة مبيعات', '143299', '48254', '2024-11-05 16:57:08', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 21 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 420, 350, 350
                    , 350, 350, 350, 350, 350, 194)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+420, netSellCostBuyPrice = netSellCostBuyPrice+350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+194;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3224351fa and sellbillId = 143299 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:27:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:57:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:57:09', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:27:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:57:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 16:57:34', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:27:42";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:57:42", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:57:42', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a2f67e424d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4756,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:44:55', '0672a2f67e424d', '4756', '0.00', '8467', '240', '1', '8707.00', '8467', '0', '8467', '1', '2024-11-05 16:57:42', '', '75', '0', 'زوزو و طمطم F4', '2', '1', '3', '86', 'زوزو و طمطم F4', '28' ,'0','','','','','-1','0','0','0','0','0','8467','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '8467', userid = '75' WHERE clientid = '4756';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4756','0.00','8467','0','اضافة فاتورة مبيعات','143300', '8467', '2024-11-05 16:57:42', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8467', '0', null, '0', null, null,'', '0','1','1','8467','1','2024-11-05 16:44:55','0','0');
UPDATE client SET  inUse = 0 where clientid = 4756;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143300', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-05 16:57:42', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523814;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-05', 466.76926610773, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+466.76926610773, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 466.76926610773, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+466.76926610773, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '50', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '51', '50', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27151;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','05571', '143300', '5', '12097', '1', '225', '225', '0', '', '1', '2024-11-05 16:57:42', '12097', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27151-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        
                where sellbilldetailid = 523815;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12097, '2024-11-05', 218.798093488, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+218.798093488, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 218.798093488, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+218.798093488, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '12096';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12097', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34450;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3174', '143300', '1', '15319', '1', '330', '330', '0', '', '1', '2024-11-05 16:57:42', '15319', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34450-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 178, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523816;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15319, '2024-11-05', 320.90387044906, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320.90387044906, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320.90387044906, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320.90387044906, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '15318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15319', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34884;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3235', '143300', '1', '15538', '1', '300', '300', '0', '', '1', '2024-11-05 16:57:42', '15538', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34884-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 208, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523817;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15538, '2024-11-05', 291.73079131733, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+291.73079131733, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 291.73079131733, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+291.73079131733, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '15537';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15538', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34512;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06777', '143300', '5', '15370', '1', '220', '220', '0', '', '1', '2024-11-05 16:57:42', '15370', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34512-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 164.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 164.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 103, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523818;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15370, '2024-11-05', 213.93591363271, 165, 165
                    , 164, 165, 164, 162.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 103, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+213.93591363271, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+164
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+164
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+162.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+103
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 213.93591363271, 165, 165
                    , 164, 165, 164, 162.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 103, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+213.93591363271, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+164
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+164
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+162.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+103
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '15369';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15370', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32732;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','06453', '143300', '5', '14754', '1', '325', '325', '0', '', '1', '2024-11-05 16:57:42', '14754', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32732-1,','1','1','0','0','325','325','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        
                where sellbilldetailid = 523819;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14754, '2024-11-05', 316.04169059378, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+316.04169059378, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 316.04169059378, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+316.04169059378, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '14753';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14754', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 16:57:42','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','R2526', '143300', '1', '12291', '1', '170', '170', '0', '', '1', '2024-11-05 16:57:42', '12291', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','170','170','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        
                where sellbilldetailid = 523820;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12291, '2024-11-05', 165.31411507982, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165.31411507982, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165.31411507982, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165.31411507982, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '12290';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12291', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30739;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('90','R2784', '143300', '1', '13833', '1', '70', '70', '0', '', '1', '2024-11-05 16:57:42', '13833', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30739-1,','1','1','0','0','70','70','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 90.00 , meanbuyprice = 90.00, lastbuyprice_withDiscount = 90.00, meanbuyprice_withDiscount = 90.00
        
                where sellbilldetailid = 523821;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13833, '2024-11-05', 68.070517974044, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+68.070517974044, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+90
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 68.070517974044, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+68.070517974044, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+90
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '13832';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13833', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34526;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06866', '143300', '5', '15640', '1', '310', '310', '0', '', '1', '2024-11-05 16:57:42', '15640', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34526-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523822;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15640, '2024-11-05', 301.45515102791, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+301.45515102791, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 301.45515102791, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+301.45515102791, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '15639';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15640', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31591;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06246', '143300', '5', '14201', '1', '120', '120', '0', '', '1', '2024-11-05 16:57:42', '14201', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31591-1,','1','1','0','0','120','120','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        
                where sellbilldetailid = 523823;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14201, '2024-11-05', 116.69231652693, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+116.69231652693, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 116.69231652693, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+116.69231652693, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 16:57:42' WHERE storedetailid = '14200';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14201', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 16:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34723;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06913', '143300', '5', '15757', '1', '340', '340', '0', '', '1', '2024-11-05 16:57:43', '15757', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34723-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 281.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 281.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 282, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 523824;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15757, '2024-11-05', 330.62823015964, 280, 280
                    , 281, 280, 281, 282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330.62823015964, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+281
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+281
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330.62823015964, 280, 280
                    , 281, 280, 281, 282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330.62823015964, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+281
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+281
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '35', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15756';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15757', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '35', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143300', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-05 16:57:43', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 282.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 282.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523825;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 340.35258987022, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340.35258987022, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340.35258987022, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340.35258987022, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '79', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '80', '79', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34593;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','06695', '143300', '5', '15213', '1', '510', '510', '0', '', '1', '2024-11-05 16:57:43', '15213', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34593-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 458.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 458.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 523826;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15213, '2024-11-05', 495.94234523946, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+495.94234523946, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 495.94234523946, 460, 450
                    , 458, 450, 458, 451.11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+495.94234523946, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+458
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+458
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+451.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15213', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 16:57:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05851', '143300', '5', '13037', '1', '440', '440', '0', '', '1', '2024-11-05 16:57:43', '13037', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','440','440','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 523827;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13037, '2024-11-05', 427.87182726542, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+427.87182726542, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 427.87182726542, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+427.87182726542, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '13036';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13037', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33983;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','R3175', '143300', '1', '15325', '1', '270', '270', '0', '', '1', '2024-11-05 16:57:43', '15325', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33983-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where sellbilldetailid = 523828;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15325, '2024-11-05', 262.5577121856, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+262.5577121856, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 262.5577121856, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+262.5577121856, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15324';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15325', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 16:57:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05404', '143300', '5', '11767', '1', '420', '420', '0', '', '1', '2024-11-05 16:57:43', '11767', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        
                where sellbilldetailid = 523829;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11767, '2024-11-05', 408.42310784426, 495, 495
                    , 495, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+408.42310784426, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 408.42310784426, 495, 495
                    , 495, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+408.42310784426, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '11766';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11767', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','H1408', '143300', '14', '15693', '1', '600', '600', '0', '', '1', '2024-11-05 16:57:43', '15693', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34605-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 523830;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15693, '2024-11-05', 583.46158263466, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+583.46158263466, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 583.46158263466, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+583.46158263466, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15693', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '75', '2024-11-05 16:57:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('595','H1400', '143300', '14', '15652', '1', '650', '650', '0', '', '1', '2024-11-05 16:57:43', '15652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 595.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 595.00
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where sellbilldetailid = 523831;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15652, '2024-11-05', 632.08338118755, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+632.08338118755, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 632.08338118755, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+632.08338118755, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-3', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-2', '-3', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20803;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','H1089', '143300', '14', '9567', '1', '490', '490', '0', '', '1', '2024-11-05 16:57:43', '9567', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','20803-1,','1','1','0','0','490','490','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523832;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9567, '2024-11-05', 476.49362581831, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+476.49362581831, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 476.49362581831, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+476.49362581831, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '9566';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9567', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34714;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06911', '143300', '5', '15755', '1', '240', '240', '0', '', '1', '2024-11-05 16:57:43', '15755', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34714-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 523833;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15755, '2024-11-05', 233.38463305386, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+233.38463305386, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 233.38463305386, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+233.38463305386, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15754';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15755', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34607;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06986', '143300', '5', '15695', '1', '310', '310', '0', '', '1', '2024-11-05 16:57:43', '15695', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34607-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523834;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15695, '2024-11-05', 301.45515102791, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+301.45515102791, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 301.45515102791, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+301.45515102791, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15694';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15695', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33218;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06240', '143300', '5', '14193', '1', '285', '285', '0', '', '1', '2024-11-05 16:57:43', '14193', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33218-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523835;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14193, '2024-11-05', 277.14425175146, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+277.14425175146, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 277.14425175146, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+277.14425175146, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '14192';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14193', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34712;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('470','06847', '143300', '5', '15578', '1', '520', '520', '0', '', '1', '2024-11-05 16:57:43', '15578', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34712-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 469.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 469.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 353, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 523836;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15578, '2024-11-05', 505.66670495004, 470, 470
                    , 469, 470, 469, 468.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 470, 353, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+505.66670495004, sellCostBuyPrice =sellCostBuyPrice+470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+469
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+469
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+468.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+353
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 505.66670495004, 470, 470
                    , 469, 470, 469, 468.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 470, 353, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+505.66670495004, sellCostBuyPrice =sellCostBuyPrice+470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+469
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+469
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+468.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+353
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '15577';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15578', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '75', '2024-11-05 16:57:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32243;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('395','06357', '143300', '5', '14520', '1', '390', '390', '0', '', '1', '2024-11-05 16:57:43', '14520', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32243-1,','1','1','0','0','390','390','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 395.00, meanbuyprice_withDiscount = 395.00
        
                where sellbilldetailid = 523837;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14520, '2024-11-05', 379.25002871253, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+379.25002871253, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 379.25002871253, 395, 395
                    , 395, 395, 395, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+379.25002871253, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+395
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+395
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '14519';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14520', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 16:57:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100','عرض 100', '143300', '18', '10345', '1', '100', '100', '0', '', '1', '2024-11-05 16:57:43', '10345', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        
                where sellbilldetailid = 523838;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10345, '2024-11-05', 97.243597105777, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+97.243597105777, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 97.243597105777, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+97.243597105777, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-61', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '10344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10345', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-60', '-61', '75', '2024-11-05 16:57:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','R2595', '143300', '1', '12664', '1', '135', '135', '0', '', '1', '2024-11-05 16:57:43', '12664', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 238.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 238.00
        
                where sellbilldetailid = 523839;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12664, '2024-11-05', 131.2788560928, 185, 185
                    , 238, 185, 238, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+131.2788560928, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+238
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+238
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 131.2788560928, 185, 185
                    , 238, 185, 238, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+131.2788560928, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+238
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+238
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 16:57:43' WHERE storedetailid = '12663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12664', '1', '1', '1', '143300', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 16:57:43','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143300', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 16:57:43', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143300', '17', '10291', '1', '87', '87', '0', '', '1', '2024-11-05 16:57:43', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','87','87','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 4756;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 8467, 8020, 8010
                    , 8067, 8000, 8057, 7894.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4405, 3764, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8467, sellCostBuyPrice =sellCostBuyPrice+8020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8067
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8057
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7894.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4405
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3764
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4756, '2024-11-05', 8467, 8020, 8010
                    , 8067, 8000, 8057, 7894.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4405, 3764, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8467, sellCostBuyPrice =sellCostBuyPrice+8020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8067
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8057
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7894.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4405
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3764
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 8467, 8020, 8010
                    , 8067, 8000, 8057, 7894.1, 4405, 3764)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8467, netSellCostBuyPrice = netSellCostBuyPrice+8020
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8010
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8067
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8000
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8057
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7894.1
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4405
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3764;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a2f67e424d and sellbillId = 143300 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:27:44";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 16:57:44", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:57:44', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:11";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:58:11", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:58:11', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a314c4cc43', '2024-11-05 16:53:00', '27', '323675.00', '332825', '0', '0', '9150',  '9150', '0', '9150', '1', '2024-11-05 16:58:11', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1393', '13621', '14', '15597', '10', '460', '4600', '0', '', '2024-11-05 16:58:11', '15597','','','0','0','0','0','0',null,'460','4600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:53:00', 1, 15597, 0, 0
                    , 460, 10, 0, 0, 77, '2024-11-05 16:58:11')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:58:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15597', '460', '10', '0', 'buyBillController.php', '31375', '', '0', '0');
UPDATE product SET  productBuyPrice = "460" WHERE productId = 15597 ;
UPDATE buybilldetail SET  quantitybefore = 7 WHERE buybilldetailid = 31375 ;
UPDATE product SET productName = 'H1393', productDescription = '', productCatId = '14', productBuyPrice = '460.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1393',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='460'  WHERE productId = '15597';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 31375;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 15597;
UPDATE storedetail SET  productquantity = '17', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15597', '1', '10', '0', '13621', 'اضافة فاتورة مشتريات', 'buyBillController.php', '7', '17', '77', '2024-11-05 16:53:00','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1466', '13621', '14', '15872', '10', '455', '4550', '0', '', '2024-11-05 16:58:11', '15872','','','0','0','0','0','0',null,'455','4550','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:53:00', 1, 15872, 0, 0
                    , 455, 10, 0, 0, 77, '2024-11-05 16:58:11')
                ON DUPLICATE KEY UPDATE buyprice = 455,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 16:58:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15872', '455', '10', '0', 'buyBillController.php', '31376', '', '0', '0');
UPDATE product SET  productBuyPrice = "455" WHERE productId = 15872 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31376 ;
UPDATE product SET productName = 'H1466', productDescription = '', productCatId = '14', productBuyPrice = '455.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1466',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '455',meanbuyprice_withDiscount = '455' , productbuypricereal = '455.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='455',meanbuyprice_withTax='455',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='455'  WHERE productId = '15872';
UPDATE buybilldetail SET  lastbuyprice = 455 , meanbuyprice = 455, lastbuyprice_withDiscount = 455, meanbuyprice_withDiscount = 455
        , lastbuyprice_withTax = 455, meanbuyprice_withTax = 455, lastbuyprice_withDiscountAndTax = 455
                where buybilldetailid = 31376;
UPDATE productunit SET proUnitBuyPrice  = 455 * productnumber WHERE productid = 15872;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15871';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15872', '1', '10', '0', '13621', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '10', '77', '2024-11-05 16:53:00','0','0');
UPDATE supplier SET  suppliercurrentDebt = '332825',suppliercurrentDebtInCurrency= '332825' , userid = '77', supplierdate = '2024-11-05 16:58:11'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '323675.00', '9150', '0', 'اضافة فاتورة مشتريات', '13621', '332825', '2024-11-05 16:53:00', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','9150','1','323675','9150','332825','0');
update buybill set dailyentryid='0,' where buybillid=13621;
COMMIT;
UPDATE product SET overAllAveragePrice = 460 WHERE productId = 15597;UPDATE product SET overAllAveragePrice = 455 WHERE productId = 15872;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:12";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:58:12", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:58:12', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13621');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:16";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:58:16", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 16:58:16', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:24";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:58:24", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 16:58:24', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=add');
BEGIN;
CALL supplierInUse(243,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('243', '74280.00', '3000', '1', 'ايصال دفع لمورد', '1', '71280', '2024-11-05 16:57:34', '9', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','3000','1','0','0','0','93');
UPDATE supplierdebtchange SET supplierid = '243', supplierdebtchangebefore = '74280.00', supplierdebtchangeamount = '3000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '71280', supplierdebtchangedate = '2024-11-05 16:57:34', userid = '9', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='3000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='74280',debtchangamountInSupplierCurrency='71280',debtchangafterInSupplierCurrency='71280', paySerialNo='93' WHERE supplierdebtchangeid = '25750';
UPDATE supplier SET  suppliercurrentDebt = '71280',suppliercurrentDebtInCurrency= '71280' , userid = '9', supplierdate = '2024-11-05 16:58:24'   WHERE supplierid = '243';
UPDATE supplier SET  inUse = 0 where supplierid = 243;
UPDATE save SET  savecurrentvalue = '45254',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('48254.00','3000', '1', '1', 'ايصال دفع لمورد', '25750', '45254', '2024-11-05 16:58:24', '9',  'supplierPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3000', '3000', '2024-11-05', '9', '0', '0', '2024-11-05 16:58:25','ايصال دفع لمورد ( مستر جو ) ','1','0','0','0','25750','supplierReportsController.php?do=show&id=25750');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118949', '-1', '3000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '3000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118949', '-1', '3000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-3000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE supplierdebtchange SET supplierid = '243', supplierdebtchangebefore = '74280.00', supplierdebtchangeamount = '3000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '71280.00', supplierdebtchangedate = '2024-11-05 16:57:34', userid = '9', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '118949',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='3000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='74280',debtchangamountInSupplierCurrency='71280',debtchangafterInSupplierCurrency='71280', paySerialNo='93' WHERE supplierdebtchangeid = '25750';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:58:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 16:58:25', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:58:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 16:58:27', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:58:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 16:58:27', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:33";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:58:33", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 16:58:33', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13621&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 16:58:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 16:58:37', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:45";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:58:45", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 16:58:45', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:28:51";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:58:51", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 16:58:51', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:29:16";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:59:16", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 16:59:16', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=2391');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:29:25";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:59:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 16:59:25', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:29:31";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:59:31", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 16:59:31', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:29:34";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:59:34", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:59:34', '77', 'editreturn', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editreturn&id=2391');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:29:39";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:59:39", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 16:59:39', '77', 'update', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=update');
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 4) and  modelid = 2391;
UPDATE returnbuybill SET  returnbuybillsysdate = '2024-11-05 16:59:39', userid = null,delbyuserid = '77', conditions = '1' WHERE returnbuybillid = '2391';
UPDATE product SET productName = '6863', productDescription = '', productCatId = '5', productBuyPrice = '465.00', productSellAllPrice = '530.00', productSellUnitPrice = '530.00', productSellHalfPrice = '530.00', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '1', parcode = '06863',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '465',lastbuyprice_withDiscount = '465',meanbuyprice = '465',meanbuyprice_withDiscount = '465' , productbuypricereal = '465.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='465',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='465',meanbuyprice_withTax='465',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='465'  WHERE productId = '15637';
UPDATE productunit SET proUnitBuyPrice  = 465 * productnumber WHERE productid = 15637;
UPDATE storedetail SET  productquantity = '18', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15636';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15637', '1', '1', '0', '2391', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '17', '18', '77', '2024-11-02 12:16:39','0','0');
UPDATE product SET productName = '6789', productDescription = '', productCatId = '5', productBuyPrice = '205.00', productSellAllPrice = '265.00', productSellUnitPrice = '265.00', productSellHalfPrice = '265.00', productDate = '2024-10-10', conditions = '0', userId = '77', limitamount = '1', parcode = '06789',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '205',lastbuyprice_withDiscount = '205',meanbuyprice = '205',meanbuyprice_withDiscount = '205' , productbuypricereal = '205.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='205',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='205',meanbuyprice_withTax='78',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='205'  WHERE productId = '15400';
UPDATE productunit SET proUnitBuyPrice  = 205 * productnumber WHERE productid = 15400;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15399';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15400', '1', '2', '0', '2391', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '8', '10', '77', '2024-11-02 12:16:39','0','0');
UPDATE product SET productName = '6826', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-10-16', conditions = '0', userId = '77', limitamount = '1', parcode = '06826',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '180.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='197',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15509';
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 15509;
UPDATE storedetail SET  productquantity = '24', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15508';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15509', '1', '1', '0', '2391', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '23', '24', '77', '2024-11-02 12:16:39','0','0');
UPDATE supplier SET  suppliercurrentDebt = '333975',suppliercurrentDebtInCurrency= '333975' , userid = '77', supplierdate = '2024-11-05 16:59:39'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '332865.00', '1110', '0', 'حذف فاتورة مردودات مشتريات', '2391', '333975', '2024-11-02 12:16:39', '77', 'returnBuyBillController.php', 'حذف فاتورة مردودات مشتريات', '0','', '0','1','1','1110','1','332865','-1110','333975','0');
UPDATE save SET  savecurrentvalue = '45254',  userid = '77' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('45254.00','0', '1', '1', 'حذف فاتورة مردودات مشتريات', '2391', '45254', '2024-11-02 12:16:39', '77',  'returnBuyBillController.php','0','','0');
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client) VALUES ('06725fc078063d', '2024-11-02 12:16:39', '175', '333975.00', '333100', '0', '0', '-875', '-875', '0', '-875', '1', '2024-11-05 16:59:39', '', '77', '0', '', '1', '6' ,'1' ,'2391','returnBuyBillController.php','0.00','-1','1','0','0','0');
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax) VALUES ('06863', '2397', '5', '15637', '1.00', '465', '465', '0.00', '', '15637','','','0','0','0','0','0','465','465','0','0','0','0','0','0','0');
UPDATE product SET productName = '6863', productDescription = '', productCatId = '5', productBuyPrice = '465.00', productSellAllPrice = '530.00', productSellUnitPrice = '530.00', productSellHalfPrice = '530.00', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '1', parcode = '06863',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '465',lastbuyprice_withDiscount = '0',meanbuyprice = '465',meanbuyprice_withDiscount = '465' , productbuypricereal = '465.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='465',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='465',meanbuyprice_withTax='465',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15637';
UPDATE returnbuybilldetail SET  lastbuyprice = 465 , meanbuyprice = 465, lastbuyprice_withDiscount = 0, meanbuyprice_withDiscount = 465
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 465
                where returnbuybilldetailid = 3749;
UPDATE productunit SET proUnitBuyPrice  = 465 * productnumber WHERE productid = 15637;
UPDATE storedetail SET  productquantity = '17', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15636';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15637', '1', '1', '1', '2397', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '18', '17', '77', '2024-11-02 12:16:39','0','0');
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax) VALUES ('06789', '2397', '5', '15400', '2.00', '205', '410', '0.00', '', '15400','','','0','0','0','0','0','205','410','0','0','0','0','0','0','0');
UPDATE product SET productName = '6789', productDescription = '', productCatId = '5', productBuyPrice = '205.00', productSellAllPrice = '265.00', productSellUnitPrice = '265.00', productSellHalfPrice = '265.00', productDate = '2024-10-10', conditions = '0', userId = '77', limitamount = '1', parcode = '06789',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '205',lastbuyprice_withDiscount = '0',meanbuyprice = '205',meanbuyprice_withDiscount = '205' , productbuypricereal = '205.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='205',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='205',meanbuyprice_withTax='36',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15400';
UPDATE returnbuybilldetail SET  lastbuyprice = 205 , meanbuyprice = 205, lastbuyprice_withDiscount = 0, meanbuyprice_withDiscount = 205
        , lastbuyprice_withTax = 205, meanbuyprice_withTax = 36
                where returnbuybilldetailid = 3750;
UPDATE productunit SET proUnitBuyPrice  = 205 * productnumber WHERE productid = 15400;
UPDATE storedetail SET  productquantity = '8', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15399';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15400', '1', '2', '1', '2397', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '10', '8', '77', '2024-11-02 12:16:39','0','0');
UPDATE supplier SET  suppliercurrentDebt = '333100',suppliercurrentDebtInCurrency= '333100' , userid = '77', supplierdate = '2024-11-05 16:59:39'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '333975.00', '875', '1', 'اضافة فاتورة مردوات مشتريات', '2397', '333100', '2024-11-02 12:16:39', '77', 'returnBuyBillController.php', 'اضافة فاتورة مردوات مشتريات', '0','', '0','1','1','1110','1','333975','875','333100','0');
UPDATE save SET  savecurrentvalue = '45254',  userid = '77' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('45254.00','0', '0', '1', 'اضافة فاتورة مردوات مشتريات', '2397', '45254', '2024-11-02 12:16:39', '77',  'returnBuyBillController.php','0','','0');
update returnbuybill set dailyentryid='0,' where returnbuybillid=2397;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:29:40";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:59:40", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 16:59:40', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=editprint&id=2397');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:29:47";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 16:59:47", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 16:59:47', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE userid = 75;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:31:52";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:01:52", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:01:52', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a326893b73
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7012,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:57:44', '0672a326893b73', '7012', '0.00', '1136', '0', '1', '1136.00', '1136', '0', '1136', '1', '2024-11-05 17:01:53', '', '75', '0', 'سمية ميدان لبنان X93', '2', '1', '3', '85', 'سمية ميدان لبنان X93', '6' ,'0','','','','','-1','0','0','0','0','0','1136','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1136', userid = '75' WHERE clientid = '7012';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7012','0.00','1136','0','اضافة فاتورة مبيعات','143301', '1136', '2024-11-05 17:01:53', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1136', '0', null, '0', null, null,'', '0','1','1','1136','1','2024-11-05 16:57:44','0','0');
UPDATE client SET  inUse = 0 where clientid = 7012;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06861', '143301', '5', '15635', '1', '300', '300', '0', '', '1', '2024-11-05 17:01:53', '15635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34892-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 226.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 226.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 226, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523842;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15635, '2024-11-05', 300, 230, 230
                    , 226, 230, 226, 233.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 226, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+233.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+226
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 230, 230
                    , 226, 230, 226, 233.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 226, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+233.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+226
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '75', storedetaildate = '2024-11-05 17:01:53' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '1', '1', '143301', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '75', '2024-11-05 17:01:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32884;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R3074', '143301', '1', '14841', '1', '280', '280', '0', '', '1', '2024-11-05 17:01:53', '14841', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32884-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523843;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14841, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 17:01:53' WHERE storedetailid = '14840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14841', '1', '1', '1', '143301', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 17:01:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34677;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06864', '143301', '5', '15647', '1', '190', '190', '0', '', '1', '2024-11-05 17:01:53', '15647', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34677-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523844;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15647, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 17:01:53' WHERE storedetailid = '15646';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15647', '1', '1', '1', '143301', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 17:01:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31288;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06178', '143301', '5', '13995', '1', '335', '335', '0', '', '1', '2024-11-05 17:01:53', '13995', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31288-1,','1','1','0','0','335','335','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 523845;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13995, '2024-11-05', 335, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+335, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 335, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+335, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 17:01:53' WHERE storedetailid = '13994';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13995', '1', '1', '1', '143301', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 17:01:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143301', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:01:53', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143301', '17', '10291', '1', '11', '11', '0', '', '1', '2024-11-05 17:01:53', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11','11','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 7012;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1136, 910, 910
                    , 906, 910, 906, 913.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,370, 366, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1136, sellCostBuyPrice =sellCostBuyPrice+910
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+910, sellCostMeanBuyPrice = sellCostMeanBuyPrice+906
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+910, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+906
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+913.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+366
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7012, '2024-11-05', 1136, 910, 910
                    , 906, 910, 906, 913.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,370, 366, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1136, sellCostBuyPrice =sellCostBuyPrice+910
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+910, sellCostMeanBuyPrice = sellCostMeanBuyPrice+906
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+910, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+906
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+913.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+366
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1136, 910, 910
                    , 906, 910, 906, 913.33, 370, 366)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1136, netSellCostBuyPrice = netSellCostBuyPrice+910
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+910
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+906
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+910
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+906
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+913.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+370
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+366;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a326893b73 and sellbillId = 143301 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:31:53";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:01:53", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:01:53', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:32:58";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:02:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 17:02:58', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:32:59";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:33:20";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:03:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:03:20', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:33:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:03:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:03:29', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a329de93f1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:58:37', '0672a329de93f1', '1', '0.00', '0', '0', '1', '900.00', '900', '900', '0', '1', '2024-11-05 17:03:29', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','900','0','','0','0','900','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143302', '0', '2024-11-05 17:03:29', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '900', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:58:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34783;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1416', '143302', '14', '15796', '1', '900', '900', '0', '', '1', '2024-11-05 17:03:29', '15796', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34783-1,','1','1','0','0','900','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 523848;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15796, '2024-11-05', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '9', storedetaildate = '2024-11-05 17:03:29' WHERE storedetailid = '15795';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15796', '1', '1', '1', '143302', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '9', '2024-11-05 17:03:29','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '46154',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('45254','900', '0', '1', 'اضافة فاتورة مبيعات', '143302', '46154', '2024-11-05 17:03:29', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 900, 670, 670
                    , 670, 670, 670, 670, 670, 670)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+900, netSellCostBuyPrice = netSellCostBuyPrice+670
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+670
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+670
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+670
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+670
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+670
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+670
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+670;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a329de93f1 and sellbillId = 143302 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:33:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:03:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:03:30', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:33:35";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:03:35", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:03:35', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a336201f61
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4756,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:01:54', '0672a336201f61', '4756', '8467.00', '8548', '0', '1', '81.00', '81', '0', '81', '1', '2024-11-05 17:03:35', '', '75', '0', 'زوزو و طمطم F4', '2', '1', '3', '86', 'زوزو و طمطم F4', '2' ,'0','','','','','-1','0','0','0','0','0','81','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '8548', userid = '75' WHERE clientid = '4756';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4756','8467.00','81','0','اضافة فاتورة مبيعات','143303', '8548', '2024-11-05 17:03:35', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '81', '0', null, '0', null, null,'', '0','1','1','81','1','2024-11-05 17:01:54','0','0');
UPDATE client SET  inUse = 0 where clientid = 4756;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34449;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3251', '143303', '1', '15589', '1', '80', '80', '0', '', '1', '2024-11-05 17:03:35', '15589', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34449-1,','1','1','0','0','80','80','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523849;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15589, '2024-11-05', 80, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+80, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 80, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+80, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '75', storedetaildate = '2024-11-05 17:03:35' WHERE storedetailid = '15588';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15589', '1', '1', '1', '143303', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '75', '2024-11-05 17:03:35','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143303', '17', '10291', '1', '1', '1', '0', '', '1', '2024-11-05 17:03:35', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1','1','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 4756;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 81, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+81, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4756, '2024-11-05', 81, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+81, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 81, 285, 285
                    , 285, 285, 285, 285, 285, 285)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+81, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+285;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a336201f61 and sellbillId = 143303 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:33:35";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:03:35", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:03:35', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:33:39";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:03:39", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:03:39', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:04:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:04:02', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235915
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3095,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 17:04:02', userid = '2' WHERE clientid = '3095';
UPDATE client SET  inUse = 0 where clientid = 3095;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3095','4351.00','4351','1','ايصال تحصيل (( قبض من عميل ))','235915', '0', '2024-11-05 17:03:20', '2', 'clientPayedDeptController.php', '   ', '4351', '0', null, '0', null, null,'', '-1','1','1','4351','1','','800','0');
UPDATE save SET  savecurrentvalue = '194241.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('189890.50','4351', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235917', '194241.5', '2024-11-05 17:04:02', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4351', '4351', '2024-11-05', '2', '0', '0', '2024-11-05 17:04:02','اضافة ايصال سداد للعميل اسراء رزق K36','1','0','0','0','235917','clientPayedDeptController.php?do=show&id=235917');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118950', '-1', '4351', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '4351', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118950', '-1', '4351', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-4351', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3095', clientdebtchangebefore = '4351.000', clientdebtchangeamount = '4351.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235915', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 17:03:20', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '4351.00',discount='', reciptid='0', dailyentryid = '118950',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='4351',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235917';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235915 -clientdebtchangeId = 235917
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:04:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:04:02', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:04:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:04:22', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235918
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5787,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 17:04:22', userid = '2' WHERE clientid = '5787';
UPDATE client SET  inUse = 0 where clientid = 5787;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5787','909.00','909','1','ايصال تحصيل (( قبض من عميل ))','235918', '0', '2024-11-05 17:04:03', '2', 'clientPayedDeptController.php', '   ', '909', '0', null, '0', null, null,'', '-1','1','1','909','1','','801','0');
UPDATE save SET  savecurrentvalue = '195150.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('194241.50','909', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235918', '195150.5', '2024-11-05 17:04:22', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('شيماء فكري F4', 'شيماء فكري F4', 'شيماء فكري F4', 'شيماء فكري F4', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:04:22');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '909', '909', '2024-11-05', '2', '0', '0', '2024-11-05 17:04:22','اضافة ايصال سداد للعميل شيماء فكري F4','1','0','0','0','235918','clientPayedDeptController.php?do=show&id=235918');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118951', '-1', '909', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '909', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118951', '11210', '909', '','0');
UPDATE accountstree SET name = 'شيماء فكري F4', customName = 'شيماء فكري F4', customNameEn = 'شيماء فكري F4', nameEn = 'شيماء فكري F4', parent = '58', accountNature = '0', theValue = '-909', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:04:22' WHERE id = '11210';
UPDATE clientdebtchange SET clientid = '5787', clientdebtchangebefore = '909.000', clientdebtchangeamount = '909.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235918', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 17:04:03', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '909.00',discount='', reciptid='0', dailyentryid = '118951',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='909',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235918';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235918 -clientdebtchangeId = 235918
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:04:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:04:22', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:28";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:04:29", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:04:29', '75', '', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:40";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:04:40", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:04:40', '75', 'show', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:04:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:04:43', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235919
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7619,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '15' , clientdate = '2024-11-05 17:04:43', userid = '2' WHERE clientid = '7619';
UPDATE client SET  inUse = 0 where clientid = 7619;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7619','318.00','303','1','ايصال تحصيل (( قبض من عميل ))','235919', '15', '2024-11-05 17:04:22', '2', 'clientPayedDeptController.php', '   ', '303', '0', null, '0', null, null,'', '-1','1','1','303','1','','802','0');
UPDATE save SET  savecurrentvalue = '195453.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('195150.50','303', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235919', '195453.5', '2024-11-05 17:04:43', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مارتينا ايمن اسوان f601', 'مارتينا ايمن اسوان f601', 'مارتينا ايمن اسوان f601', 'مارتينا ايمن اسوان f601', '58', '0', '15.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:04:43');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '303', '303', '2024-11-05', '2', '0', '0', '2024-11-05 17:04:43','اضافة ايصال سداد للعميل مارتينا ايمن اسوان f601','1','0','0','0','235919','clientPayedDeptController.php?do=show&id=235919');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118952', '-1', '303', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '303', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118952', '11211', '303', '','0');
UPDATE accountstree SET name = 'مارتينا ايمن اسوان f601', customName = 'مارتينا ايمن اسوان f601', customNameEn = 'مارتينا ايمن اسوان f601', nameEn = 'مارتينا ايمن اسوان f601', parent = '58', accountNature = '0', theValue = '-288', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:04:43' WHERE id = '11211';
UPDATE clientdebtchange SET clientid = '7619', clientdebtchangebefore = '318.000', clientdebtchangeamount = '303.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235919', clientdebtchangeafter = '15.000', clientdebtchangedate = '2024-11-05 17:04:22', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '303.00',discount='', reciptid='0', dailyentryid = '118952',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='303',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235919';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235919 -clientdebtchangeId = 235919
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:44";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:04:44", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:04:44', '75', 'showDetail', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143300');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:34:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:04:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:04:44', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:35:02";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:05:02", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:05:02', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:35:04";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:05:04", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:05:04', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:35:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:05:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 17:05:04', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:35:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:05:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:05:18', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235920
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(116,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 17:05:18', userid = '2' WHERE clientid = '116';
UPDATE client SET  inUse = 0 where clientid = 116;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('116','5763.00','5763','1','ايصال تحصيل (( قبض من عميل ))','235920', '0', '2024-11-05 17:04:44', '2', 'clientPayedDeptController.php', '   ', '5763', '0', null, '0', null, null,'', '-1','1','1','5763','1','','803','0');
UPDATE save SET  savecurrentvalue = '201216.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('195453.50','5763', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235920', '201216.5', '2024-11-05 17:05:18', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('جيجي المنيا K504', 'جيجي المنيا K504', 'جيجي المنيا K504', 'جيجي المنيا K504', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:05:18');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5763', '5763', '2024-11-05', '2', '0', '0', '2024-11-05 17:05:18','اضافة ايصال سداد للعميل جيجي المنيا K504','1','0','0','0','235920','clientPayedDeptController.php?do=show&id=235920');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118953', '-1', '5763', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '5763', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118953', '11212', '5763', '','0');
UPDATE accountstree SET name = 'جيجي المنيا K504', customName = 'جيجي المنيا K504', customNameEn = 'جيجي المنيا K504', nameEn = 'جيجي المنيا K504', parent = '58', accountNature = '0', theValue = '-5763', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:05:18' WHERE id = '11212';
UPDATE clientdebtchange SET clientid = '116', clientdebtchangebefore = '5763.000', clientdebtchangeamount = '5763.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235920', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 17:04:44', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '5763.00',discount='', reciptid='0', dailyentryid = '118953',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='5763',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235920';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235920 -clientdebtchangeId = 235920
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:35:19";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:05:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:05:19', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:35:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:05:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 17:05:23', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:35:41";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:05:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:05:41', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235921
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8766,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '2' , clientdate = '2024-11-05 17:05:41', userid = '2' WHERE clientid = '8766';
UPDATE client SET  inUse = 0 where clientid = 8766;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8766','1272.00','1270','1','ايصال تحصيل (( قبض من عميل ))','235921', '2', '2024-11-05 17:05:19', '2', 'clientPayedDeptController.php', '   ', '1270', '0', null, '0', null, null,'', '-1','1','1','1270','1','','804','0');
UPDATE save SET  savecurrentvalue = '202486.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('201216.50','1270', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235921', '202486.5', '2024-11-05 17:05:41', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('فادية عزت W4', 'فادية عزت W4', 'فادية عزت W4', 'فادية عزت W4', '58', '0', '2.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:05:41');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1270', '1270', '2024-11-05', '2', '0', '0', '2024-11-05 17:05:41','اضافة ايصال سداد للعميل فادية عزت W4','1','0','0','0','235921','clientPayedDeptController.php?do=show&id=235921');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118954', '-1', '1270', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1270', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118954', '11213', '1270', '','0');
UPDATE accountstree SET name = 'فادية عزت W4', customName = 'فادية عزت W4', customNameEn = 'فادية عزت W4', nameEn = 'فادية عزت W4', parent = '58', accountNature = '0', theValue = '-1268', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:05:41' WHERE id = '11213';
UPDATE clientdebtchange SET clientid = '8766', clientdebtchangebefore = '1272.000', clientdebtchangeamount = '1270.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235921', clientdebtchangeafter = '2.000', clientdebtchangedate = '2024-11-05 17:05:19', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1270.00',discount='', reciptid='0', dailyentryid = '118954',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1270',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235921';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235921 -clientdebtchangeId = 235921
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:35:41";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:05:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:05:41', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:36:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:06:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:06:03', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a33c2a83b6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:03:30', '0672a33c2a83b6', '1', '0.00', '0', '0', '1', '350.00', '350', '350', '0', '1', '2024-11-05 17:06:03', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','350','0','','0','0','350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143304', '0', '2024-11-05 17:06:03', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '350', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:03:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143304', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-05 17:06:03', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 282.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 282.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523851;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '78', userid = '9', storedetaildate = '2024-11-05 17:06:03' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143304', 'اضافة فاتورة مبيعات', 'sellbillController.php', '79', '78', '9', '2024-11-05 17:06:03','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '46504',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46154','350', '0', '1', 'اضافة فاتورة مبيعات', '143304', '46504', '2024-11-05 17:06:03', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 350, 285, 285
                    , 282, 285, 282, 280.91, 285, 280)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+350, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+282
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+282
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+280.91
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+280;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a33c2a83b6 and sellbillId = 143304 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:36:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:06:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:06:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:36:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:06:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:06:05', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235922
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5185,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '436' , clientdate = '2024-11-05 17:06:05', userid = '2' WHERE clientid = '5185';
UPDATE client SET  inUse = 0 where clientid = 5185;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5185','781.00','345','1','ايصال تحصيل (( قبض من عميل ))','235922', '436', '2024-11-05 17:05:41', '2', 'clientPayedDeptController.php', '   ', '345', '0', null, '0', null, null,'', '-1','1','1','345','1','','805','0');
UPDATE save SET  savecurrentvalue = '202831.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('202486.50','345', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235923', '202831.5', '2024-11-05 17:06:05', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ايناس ملاك 33', 'ايناس ملاك 33', 'ايناس ملاك 33', 'ايناس ملاك 33', '58', '0', '436.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:06:05');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '345', '345', '2024-11-05', '2', '0', '0', '2024-11-05 17:06:05','اضافة ايصال سداد للعميل ايناس ملاك 33','1','0','0','0','235923','clientPayedDeptController.php?do=show&id=235923');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118955', '-1', '345', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '345', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118955', '11214', '345', '','0');
UPDATE accountstree SET name = 'ايناس ملاك 33', customName = 'ايناس ملاك 33', customNameEn = 'ايناس ملاك 33', nameEn = 'ايناس ملاك 33', parent = '58', accountNature = '0', theValue = '91', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:06:05' WHERE id = '11214';
UPDATE clientdebtchange SET clientid = '5185', clientdebtchangebefore = '781.000', clientdebtchangeamount = '345.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235922', clientdebtchangeafter = '436.000', clientdebtchangedate = '2024-11-05 17:05:41', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '345.00',discount='', reciptid='0', dailyentryid = '118955',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='345',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235923';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235922 -clientdebtchangeId = 235923
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:36:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:06:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:06:06', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:36:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:06:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:06:46', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235924
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(235,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '706' , clientdate = '2024-11-05 17:06:47', userid = '2' WHERE clientid = '235';
UPDATE client SET  inUse = 0 where clientid = 235;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('235','1576.00','870','1','ايصال تحصيل (( قبض من عميل ))','235924', '706', '2024-11-05 17:06:06', '2', 'clientPayedDeptController.php', '   ', '870', '0', null, '0', null, null,'', '-1','1','1','870','1','','806','0');
UPDATE save SET  savecurrentvalue = '203701.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('202831.50','870', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235924', '203701.5', '2024-11-05 17:06:47', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('لمياء حداد i71', 'لمياء حداد i71', 'لمياء حداد i71', 'لمياء حداد i71', '58', '0', '706.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:06:47');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '870', '870', '2024-11-05', '2', '0', '0', '2024-11-05 17:06:47','اضافة ايصال سداد للعميل لمياء حداد i71','1','0','0','0','235924','clientPayedDeptController.php?do=show&id=235924');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118956', '-1', '870', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '870', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118956', '11215', '870', '','0');
UPDATE accountstree SET name = 'لمياء حداد i71', customName = 'لمياء حداد i71', customNameEn = 'لمياء حداد i71', nameEn = 'لمياء حداد i71', parent = '58', accountNature = '0', theValue = '-164', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:06:47' WHERE id = '11215';
UPDATE clientdebtchange SET clientid = '235', clientdebtchangebefore = '1576.000', clientdebtchangeamount = '870.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235924', clientdebtchangeafter = '706.000', clientdebtchangedate = '2024-11-05 17:06:06', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '870.00',discount='', reciptid='0', dailyentryid = '118956',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='870',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235924';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235924 -clientdebtchangeId = 235924
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:36:47";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:06:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:06:47', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:36:49";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:06:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:06:49', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:37:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:07:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:07:01', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:37:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:07:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:07:24', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235925
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9423,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-05 17:07:25', userid = '2' WHERE clientid = '9423';
UPDATE client SET  inUse = 0 where clientid = 9423;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9423','990.00','970','1','ايصال تحصيل (( قبض من عميل ))','235925', '20', '2024-11-05 17:07:02', '2', 'clientPayedDeptController.php', '   ', '970', '0', null, '0', null, null,'', '-1','1','1','970','1','','807','0');
UPDATE save SET  savecurrentvalue = '204671.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('203701.50','970', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235925', '204671.5', '2024-11-05 17:07:25', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '970', '970', '2024-11-05', '2', '0', '0', '2024-11-05 17:07:25','اضافة ايصال سداد للعميل مكتب ريمو k235','1','0','0','0','235925','clientPayedDeptController.php?do=show&id=235925');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118957', '-1', '970', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '970', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118957', '-1', '970', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-970', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '9423', clientdebtchangebefore = '990.000', clientdebtchangeamount = '970.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235925', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-05 17:07:02', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '970.00',discount='', reciptid='0', dailyentryid = '118957',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='970',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235925';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235925 -clientdebtchangeId = 235925
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:37:26";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:07:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:07:26', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:37:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:07:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:07:55', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235926
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(114,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '477.5' , clientdate = '2024-11-05 17:07:55', userid = '2' WHERE clientid = '114';
UPDATE client SET  inUse = 0 where clientid = 114;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('114','497.50','20','1','ايصال تحصيل (( قبض من عميل ))','235926', '477.5', '2024-11-05 17:07:26', '2', 'clientPayedDeptController.php', '   ', '20', '0', null, '0', null, null,'', '-1','1','1','20','1','','808','0');
UPDATE save SET  savecurrentvalue = '204691.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('204671.50','20', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235926', '204691.5', '2024-11-05 17:07:55', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('عواطف نبيل P77', 'عواطف نبيل P77', 'عواطف نبيل P77', 'عواطف نبيل P77', '58', '0', '477.50', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:07:55');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20', '20', '2024-11-05', '2', '0', '0', '2024-11-05 17:07:55','اضافة ايصال سداد للعميل عواطف نبيل P77','1','0','0','0','235926','clientPayedDeptController.php?do=show&id=235926');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118958', '-1', '20', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '20', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118958', '11216', '20', '','0');
UPDATE accountstree SET name = 'عواطف نبيل P77', customName = 'عواطف نبيل P77', customNameEn = 'عواطف نبيل P77', nameEn = 'عواطف نبيل P77', parent = '58', accountNature = '0', theValue = '457.5', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:07:55' WHERE id = '11216';
UPDATE clientdebtchange SET clientid = '114', clientdebtchangebefore = '497.500', clientdebtchangeamount = '20.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235926', clientdebtchangeafter = '477.500', clientdebtchangedate = '2024-11-05 17:07:26', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '20.00',discount='', reciptid='0', dailyentryid = '118958',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='20',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235926';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235926 -clientdebtchangeId = 235926
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:37:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:07:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:07:56', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:38:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:08:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:08:09', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:38:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:08:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:08:43', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235927
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3976,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-05 17:08:43', userid = '2' WHERE clientid = '3976';
UPDATE client SET  inUse = 0 where clientid = 3976;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3976','3136.00','3116','1','ايصال تحصيل (( قبض من عميل ))','235927', '20', '2024-11-05 17:07:56', '2', 'clientPayedDeptController.php', '   ', '3116', '0', null, '0', null, null,'', '-1','1','1','3116','1','','809','0');
UPDATE save SET  savecurrentvalue = '207807.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('204691.50','3116', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235927', '207807.5', '2024-11-05 17:08:43', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('رحاب السيد L195', 'رحاب السيد L195', 'رحاب السيد L195', 'رحاب السيد L195', '58', '0', '20.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:08:43');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3116', '3116', '2024-11-05', '2', '0', '0', '2024-11-05 17:08:43','اضافة ايصال سداد للعميل رحاب السيد L195','1','0','0','0','235927','clientPayedDeptController.php?do=show&id=235927');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118959', '-1', '3116', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '3116', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118959', '11217', '3116', '','0');
UPDATE accountstree SET name = 'رحاب السيد L195', customName = 'رحاب السيد L195', customNameEn = 'رحاب السيد L195', nameEn = 'رحاب السيد L195', parent = '58', accountNature = '0', theValue = '-3096', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:08:43' WHERE id = '11217';
UPDATE clientdebtchange SET clientid = '3976', clientdebtchangebefore = '3136.000', clientdebtchangeamount = '3116.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235927', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-05 17:07:56', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '3116.00',discount='', reciptid='0', dailyentryid = '118959',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='3116',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235927';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235927 -clientdebtchangeId = 235927
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:38:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:08:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:08:44', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:39:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:09:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:09:45', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235928
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(796,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 17:09:45', userid = '2' WHERE clientid = '796';
UPDATE client SET  inUse = 0 where clientid = 796;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('796','404.00','404','1','ايصال تحصيل (( قبض من عميل ))','235928', '0', '2024-11-05 17:08:44', '2', 'clientPayedDeptController.php', '   ', '404', '0', null, '0', null, null,'', '-1','1','1','404','1','','810','0');
UPDATE save SET  savecurrentvalue = '208211.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('207807.50','404', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235928', '208211.5', '2024-11-05 17:09:45', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('سمر يونس 58', 'سمر يونس 58', 'سمر يونس 58', 'سمر يونس 58', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:09:45');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '404', '404', '2024-11-05', '2', '0', '0', '2024-11-05 17:09:45','اضافة ايصال سداد للعميل سمر يونس 58','1','0','0','0','235928','clientPayedDeptController.php?do=show&id=235928');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118960', '-1', '404', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '404', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118960', '11218', '404', '','0');
UPDATE accountstree SET name = 'سمر يونس 58', customName = 'سمر يونس 58', customNameEn = 'سمر يونس 58', nameEn = 'سمر يونس 58', parent = '58', accountNature = '0', theValue = '-404', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:09:45' WHERE id = '11218';
UPDATE clientdebtchange SET clientid = '796', clientdebtchangebefore = '404.000', clientdebtchangeamount = '404.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235928', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 17:08:44', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '404.00',discount='', reciptid='0', dailyentryid = '118960',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='404',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235928';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235928 -clientdebtchangeId = 235928
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:39:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:09:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:09:46', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:40:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:10:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:10:18', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235929
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(114,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '285.5' , clientdate = '2024-11-05 17:10:18', userid = '2' WHERE clientid = '114';
UPDATE client SET  inUse = 0 where clientid = 114;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('114','477.50','192','1','ايصال تحصيل (( قبض من عميل ))','235929', '285.5', '2024-11-05 17:09:46', '2', 'clientPayedDeptController.php', '   ', '192', '0', null, '0', null, null,'', '-1','1','1','192','1','','811','0');
UPDATE save SET  savecurrentvalue = '208403.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('208211.50','192', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235929', '208403.5', '2024-11-05 17:10:18', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '192', '192', '2024-11-05', '2', '0', '0', '2024-11-05 17:10:18','اضافة ايصال سداد للعميل عواطف نبيل P77','1','0','0','0','235929','clientPayedDeptController.php?do=show&id=235929');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118961', '-1', '192', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '192', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118961', '-1', '192', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-192', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '114', clientdebtchangebefore = '477.500', clientdebtchangeamount = '192.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235929', clientdebtchangeafter = '285.500', clientdebtchangedate = '2024-11-05 17:09:46', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '192.00',discount='', reciptid='0', dailyentryid = '118961',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='192',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235929';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235929 -clientdebtchangeId = 235929
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:40:19";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:10:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:10:19', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:40:45";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:10:45", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:10:45', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3420e95ac
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5937,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:05:04', '0672a3420e95ac', '5937', '0.00', '848', '0', '1', '848.00', '848', '0', '848', '1', '2024-11-05 17:10:45', '', '75', '0', 'هبة صبحي x131', '2', '1', '3', '85', 'هبة صبحي x131', '6' ,'0','','','','','-1','0','0','0','0','0','848','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '848', userid = '75' WHERE clientid = '5937';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5937','0.00','848','0','اضافة فاتورة مبيعات','143305', '848', '2024-11-05 17:10:45', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '848', '0', null, '0', null, null,'', '0','1','1','848','1','2024-11-05 17:05:04','0','0');
UPDATE client SET  inUse = 0 where clientid = 5937;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33040;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06520', '143305', '5', '14911', '1', '230', '230', '0', '', '1', '2024-11-05 17:10:45', '14911', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33040-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        
                where sellbilldetailid = 523852;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14911, '2024-11-05', 230, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 230, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 17:10:45' WHERE storedetailid = '14910';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14911', '1', '1', '1', '143305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 17:10:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30964;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265','R2671', '143305', '1', '13108', '1', '290', '290', '0', '', '1', '2024-11-05 17:10:45', '13108', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30964-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 264.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 264.00
        
                where sellbilldetailid = 523853;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13108, '2024-11-05', 290, 265, 265
                    , 264, 265, 264, 253.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+264
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+264
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+253.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 265, 265
                    , 264, 265, 264, 253.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+264
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+264
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+253.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 17:10:45' WHERE storedetailid = '13107';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13108', '1', '1', '1', '143305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-05 17:10:45','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100','عرض 100', '143305', '18', '10345', '1', '100', '100', '0', '', '1', '2024-11-05 17:10:45', '10345', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        
                where sellbilldetailid = 523854;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10345, '2024-11-05', 100, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 100, 100, 100
                    , 100, 100, 100, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-62', userid = '75', storedetaildate = '2024-11-05 17:10:45' WHERE storedetailid = '10344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10345', '1', '1', '1', '143305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-61', '-62', '75', '2024-11-05 17:10:45','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','عرض 200', '143305', '18', '10353', '1', '200', '200', '0', '', '1', '2024-11-05 17:10:45', '10353', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        
                where sellbilldetailid = 523855;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10353, '2024-11-05', 200, 200, 200
                    , 200, 200, 200, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 200, 200
                    , 200, 200, 200, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-5', userid = '75', storedetaildate = '2024-11-05 17:10:45' WHERE storedetailid = '10352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10353', '1', '1', '1', '143305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-4', '-5', '75', '2024-11-05 17:10:45','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143305', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:10:45', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143305', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-05 17:10:45', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 5937;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 848, 740, 740
                    , 739, 740, 739, 428.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+848, sellCostBuyPrice =sellCostBuyPrice+740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+739
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+739
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+428.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5937, '2024-11-05', 848, 740, 740
                    , 739, 740, 739, 428.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+848, sellCostBuyPrice =sellCostBuyPrice+740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+739
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+739
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+428.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 848, 740, 740
                    , 739, 740, 739, 428.33, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+848, netSellCostBuyPrice = netSellCostBuyPrice+740
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+740
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+739
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+740
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+739
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+428.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3420e95ac and sellbillId = 143305 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:40:46";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:10:46", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:10:46', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:41:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:11:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:11:05', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235930
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(198,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 17:11:06', userid = '2' WHERE clientid = '198';
UPDATE client SET  inUse = 0 where clientid = 198;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('198','950.00','950','1','ايصال تحصيل (( قبض من عميل ))','235930', '0', '2024-11-05 17:10:19', '2', 'clientPayedDeptController.php', '   ', '950', '0', null, '0', null, null,'', '-1','1','1','950','1','','812','0');
UPDATE save SET  savecurrentvalue = '209353.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('208403.50','950', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235931', '209353.5', '2024-11-05 17:11:06', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نهاد كرم z403', 'نهاد كرم z403', 'نهاد كرم z403', 'نهاد كرم z403', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:11:06');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '950', '950', '2024-11-05', '2', '0', '0', '2024-11-05 17:11:06','اضافة ايصال سداد للعميل نهاد كرم z403','1','0','0','0','235931','clientPayedDeptController.php?do=show&id=235931');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118962', '-1', '950', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '950', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118962', '11219', '950', '','0');
UPDATE accountstree SET name = 'نهاد كرم z403', customName = 'نهاد كرم z403', customNameEn = 'نهاد كرم z403', nameEn = 'نهاد كرم z403', parent = '58', accountNature = '0', theValue = '-950', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:11:06' WHERE id = '11219';
UPDATE clientdebtchange SET clientid = '198', clientdebtchangebefore = '950.000', clientdebtchangeamount = '950.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235930', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 17:10:19', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '950.00',discount='', reciptid='0', dailyentryid = '118962',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='950',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235931';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235930 -clientdebtchangeId = 235931
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:41:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:11:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:11:06', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:41:37";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:11:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:11:37', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235932
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(398,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 17:11:37', userid = '2' WHERE clientid = '398';
UPDATE client SET  inUse = 0 where clientid = 398;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('398','631.00','631','1','ايصال تحصيل (( قبض من عميل ))','235932', '0', '2024-11-05 17:11:07', '2', 'clientPayedDeptController.php', '   ', '631', '0', null, '0', null, null,'', '-1','1','1','631','1','','813','0');
UPDATE save SET  savecurrentvalue = '209984.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('209353.50','631', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235932', '209984.5', '2024-11-05 17:11:37', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '631', '631', '2024-11-05', '2', '0', '0', '2024-11-05 17:11:37','اضافة ايصال سداد للعميل سندس احمد K1120','1','0','0','0','235932','clientPayedDeptController.php?do=show&id=235932');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118963', '-1', '631', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '631', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118963', '-1', '631', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-631', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '398', clientdebtchangebefore = '631.000', clientdebtchangeamount = '631.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235932', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 17:11:07', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '631.00',discount='', reciptid='0', dailyentryid = '118963',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='631',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235932';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235932 -clientdebtchangeId = 235932
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:41:38";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:11:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:11:38', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:42:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:12:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:12:16', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235933
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1192,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 17:12:16', userid = '2' WHERE clientid = '1192';
UPDATE client SET  inUse = 0 where clientid = 1192;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1192','1692.00','1692','1','ايصال تحصيل (( قبض من عميل ))','235933', '0', '2024-11-05 17:11:38', '2', 'clientPayedDeptController.php', '   ', '1692', '0', null, '0', null, null,'', '-1','1','1','1692','1','','814','0');
UPDATE save SET  savecurrentvalue = '211676.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('209984.50','1692', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235933', '211676.5', '2024-11-05 17:12:16', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('شيماء محمد جمال x111', 'شيماء محمد جمال x111', 'شيماء محمد جمال x111', 'شيماء محمد جمال x111', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 17:12:16');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1692', '1692', '2024-11-05', '2', '0', '0', '2024-11-05 17:12:16','اضافة ايصال سداد للعميل شيماء محمد جمال x111','1','0','0','0','235933','clientPayedDeptController.php?do=show&id=235933');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118964', '-1', '1692', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1692', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118964', '11220', '1692', '','0');
UPDATE accountstree SET name = 'شيماء محمد جمال x111', customName = 'شيماء محمد جمال x111', customNameEn = 'شيماء محمد جمال x111', nameEn = 'شيماء محمد جمال x111', parent = '58', accountNature = '0', theValue = '-1692', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 17:12:16' WHERE id = '11220';
UPDATE clientdebtchange SET clientid = '1192', clientdebtchangebefore = '1692.000', clientdebtchangeamount = '1692.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235933', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 17:11:38', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1692.00',discount='', reciptid='0', dailyentryid = '118964',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1692',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235933';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235933 -clientdebtchangeId = 235933
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:42:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:12:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:12:17', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:42:41";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:12:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 17:12:41', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:44:25";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:14:25", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:14:25', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a357694784
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8334,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:10:46', '0672a357694784', '8334', '-5.00', '1328', '0', '1', '1333.00', '1333', '0', '1333', '1', '2024-11-05 17:14:25', '', '75', '0', 'ياسمين احمد امينI600', '2', '1', '3', '81', 'ياسمين احمد امينI600', '6' ,'0','','','','','-1','0','0','0','0','0','1333','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1328', userid = '75' WHERE clientid = '8334';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8334','-5.00','1333','0','اضافة فاتورة مبيعات','143306', '1328', '2024-11-05 17:14:25', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1333', '0', null, '0', null, null,'', '0','1','1','1333','1','2024-11-05 17:10:46','0','0');
UPDATE client SET  inUse = 0 where clientid = 8334;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143306', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-05 17:14:25', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523858;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '44', userid = '75', storedetaildate = '2024-11-05 17:14:25' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143306', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '44', '75', '2024-11-05 17:14:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143306', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-05 17:14:25', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 282.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 282.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523859;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '77', userid = '75', storedetaildate = '2024-11-05 17:14:25' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143306', 'اضافة فاتورة مبيعات', 'sellbillController.php', '78', '77', '75', '2024-11-05 17:14:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34500;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','06857', '143306', '5', '15630', '1', '230', '230', '0', '', '1', '2024-11-05 17:14:25', '15630', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34500-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523860;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15630, '2024-11-05', 230, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 230, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 17:14:25' WHERE storedetailid = '15629';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15630', '1', '1', '1', '143306', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-05 17:14:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34293;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('365','H1305', '143306', '14', '15394', '1', '450', '450', '0', '', '1', '2024-11-05 17:14:25', '15394', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34293-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 365.00
        
                where sellbilldetailid = 523861;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15394, '2024-11-05', 450, 365, 365
                    , 365, 365, 365, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 450, 365, 365
                    , 365, 365, 365, 365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 17:14:25' WHERE storedetailid = '15393';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15394', '1', '1', '1', '143306', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 17:14:25','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143306', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:14:25', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143306', '17', '10291', '1', '13', '13', '0', '', '1', '2024-11-05 17:14:26', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','13','13','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 8334;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1333, 1035, 1035
                    , 1032, 1035, 1032, 1030.91
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,670, 665, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1333, sellCostBuyPrice =sellCostBuyPrice+1035
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1032
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1032
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1030.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+665
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8334, '2024-11-05', 1333, 1035, 1035
                    , 1032, 1035, 1032, 1030.91
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,670, 665, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1333, sellCostBuyPrice =sellCostBuyPrice+1035
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1032
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1032
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1030.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+665
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1333, 1035, 1035
                    , 1032, 1035, 1032, 1030.91, 670, 665)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1333, netSellCostBuyPrice = netSellCostBuyPrice+1035
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1035
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1032
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1035
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1032
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1030.91
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+670
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+665;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a357694784 and sellbillId = 143306 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:44:26";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:14:26", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:14:26', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:44:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:14:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:14:35', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:44:47";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:14:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:14:47', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:44:52";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:14:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:14:52', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143222');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:44:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:14:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:14:54', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a320e1d79a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:56:14', '0672a320e1d79a', '1', '0.00', '0', '0', '1', '220.00', '220', '220', '0', '1', '2024-11-05 17:14:54', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','220','0','','0','0','220','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143307', '0', '2024-11-05 17:14:54', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '220', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 16:56:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33934;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06745', '143307', '5', '15298', '1', '220', '220', '0', '', '1', '2024-11-05 17:14:54', '15298', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33934-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        
                where sellbilldetailid = 523864;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15298, '2024-11-05', 220, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-05 17:14:54' WHERE storedetailid = '15297';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15298', '1', '1', '1', '143307', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-05 17:14:54','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '46724',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46504','220', '0', '1', 'اضافة فاتورة مبيعات', '143307', '46724', '2024-11-05 17:14:54', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 220, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 220, 160, 160
                    , 160, 160, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+220, netSellCostBuyPrice = netSellCostBuyPrice+160
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+160
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+160
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+160
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+160
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+160
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a320e1d79a and sellbillId = 143307 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:44:54";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:14:54", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:14:54', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('حسن عبد العزيز 33' , '', '', '01127785393', '0', '', '0', '2024-11-05 17:17:53', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10286', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10286','0','0','0','إضافة عميل جديد','10286', '0', '2024-11-05 17:17:53', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('حسن عبد العزيز 33', 'حسن عبد العزيز 33', 'حسن عبد العزيز 33', 'حسن عبد العزيز 33', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 17:17:53');
UPDATE client SET clientname = 'حسن عبد العزيز 33', clientaddress = '', clientphone = '', clientmobile = '01127785393', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11221',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10286';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:49:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:19:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:19:40', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a345c3bc3e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:06:04', '0672a345c3bc3e', '1', '0.00', '0', '0', '1', '170.00', '170', '170', '0', '1', '2024-11-05 17:19:40', '', '9', '0', 'نقدي', '1', '0', '3', '93', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','170','0','','0','0','170','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143308', '0', '2024-11-05 17:19:40', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '170', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:06:04','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('90','00M14', '143308', '11', '5002', '1', '170', '170', '0', '', '1', '2024-11-05 17:19:40', '5002', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','170','170','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 90.00 , meanbuyprice = 90.00, lastbuyprice_withDiscount = 90.00, meanbuyprice_withDiscount = 90.00
        
                where sellbilldetailid = 523865;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5002, '2024-11-05', 170, 90, 90
                    , 90, 90, 90, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 170, 90, 90
                    , 90, 90, 90, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-7', userid = '9', storedetaildate = '2024-11-05 17:19:40' WHERE storedetailid = '5001';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5002', '1', '1', '1', '143308', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-6', '-7', '9', '2024-11-05 17:19:40','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '46894',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46724','170', '0', '1', 'اضافة فاتورة مبيعات', '143308', '46894', '2024-11-05 17:19:40', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 93 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 170, 90, 90
                    , 90, 90, 90, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 170, 90, 90
                    , 90, 90, 90, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 170, 90, 90
                    , 90, 90, 90, 0, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+170, netSellCostBuyPrice = netSellCostBuyPrice+90
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+90
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+90
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+90
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+90
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a345c3bc3e and sellbillId = 143308 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:49:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:19:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:19:41', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:49:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:19:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 17:19:52', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:49:53";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:19:53", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:19:53', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:50:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:20:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 17:20:02', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '40', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '46854',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46894.00','40', '1', '1', 'إضافة مصروف', '24289', '46854', '2024-11-05 17:20:02', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '40.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24289';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:50:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:20:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 17:20:03', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:50:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:20:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 17:20:04', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:50:17";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:20:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:20:17', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3652de3cb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10286,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:14:26', '0672a3652de3cb', '10286', '0.00', '1111', '0', '1', '1111.00', '1111', '0', '1111', '1', '2024-11-05 17:20:18', '', '75', '0', 'حسن عبد العزيز 33', '2', '1', '3', '89', 'حسن عبد العزيز 33', '5' ,'0','','','','','-1','0','0','0','0','0','1111','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1111', userid = '75' WHERE clientid = '10286';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10286','0.00','1111','0','اضافة فاتورة مبيعات','143309', '1111', '2024-11-05 17:20:18', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1111', '0', null, '0', null, null,'', '0','1','1','1111','1','2024-11-05 17:14:26','0','0');
UPDATE client SET  inUse = 0 where clientid = 10286;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34520;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','R3230', '143309', '1', '15530', '1', '430', '430', '0', '', '1', '2024-11-05 17:20:18', '15530', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34520-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 273, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 523866;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15530, '2024-11-05', 430, 360, 360
                    , 355, 360, 355, 353.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+353.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 360, 360
                    , 355, 360, 355, 353.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+355
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+355
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+353.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '35', userid = '75', storedetaildate = '2024-11-05 17:20:18' WHERE storedetailid = '15529';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15530', '1', '1', '1', '143309', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '35', '75', '2024-11-05 17:20:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34378;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06823', '143309', '5', '15546', '1', '370', '370', '0', '', '1', '2024-11-05 17:20:18', '15546', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34378-1,','1','1','0','0','370','370','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 523867;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15546, '2024-11-05', 370, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 370, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 17:20:18' WHERE storedetailid = '15545';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15546', '1', '1', '1', '143309', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 17:20:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32676;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','06451', '143309', '5', '14686', '1', '280', '280', '0', '', '1', '2024-11-05 17:20:18', '14686', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32676-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        
                where sellbilldetailid = 523868;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14686, '2024-11-05', 280, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 17:20:18' WHERE storedetailid = '14685';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14686', '1', '1', '1', '143309', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 17:20:18','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143309', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:20:18', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143309', '17', '10291', '1', '11', '11', '0', '', '1', '2024-11-05 17:20:18', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11','11','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 10286;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1111, 905, 905
                    , 900, 905, 900, 898.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1111, sellCostBuyPrice =sellCostBuyPrice+905
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+905, sellCostMeanBuyPrice = sellCostMeanBuyPrice+900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+905, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+898.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10286, '2024-11-05', 1111, 905, 905
                    , 900, 905, 900, 898.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,360, 273, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1111, sellCostBuyPrice =sellCostBuyPrice+905
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+905, sellCostMeanBuyPrice = sellCostMeanBuyPrice+900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+905, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+898.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+273
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1111, 905, 905
                    , 900, 905, 900, 898.33, 360, 273)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1111, netSellCostBuyPrice = netSellCostBuyPrice+905
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+905
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+900
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+905
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+900
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+898.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+273;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3652de3cb and sellbillId = 143309 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:50:18";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:20:18", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:20:18', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:51:32";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:21:32", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:21:32', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:52:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:22:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:22:34', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:52:36";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:22:36", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:22:37', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13553');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:52:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:22:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:22:54', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:52:57";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:22:57", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:22:57', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a37b3280db
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4571,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:20:19', '0672a37b3280db', '4571', '2097.00', '2476', '0', '1', '379.00', '379', '0', '379', '1', '2024-11-05 17:22:57', '', '75', '0', 'تينا سدراك 33', '2', '1', '3', '89', 'تينا سدراك 33', '3' ,'0','','','','','-1','0','0','0','0','0','379','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2476', userid = '75' WHERE clientid = '4571';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4571','2097.00','379','0','اضافة فاتورة مبيعات','143310', '2476', '2024-11-05 17:22:57', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '379', '0', null, '0', null, null,'', '0','1','1','379','1','2024-11-05 17:20:19','0','0');
UPDATE client SET  inUse = 0 where clientid = 4571;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','05830', '143310', '5', '12935', '1', '355', '355', '0', '', '1', '2024-11-05 17:22:57', '12935', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','355','355','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        
                where sellbilldetailid = 523871;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12935, '2024-11-05', 355, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+355, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 355, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+355, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 17:22:57' WHERE storedetailid = '12934';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12935', '1', '1', '1', '143310', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 17:22:57','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143310', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:22:57', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143310', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-05 17:22:57', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 4571;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 379, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+379, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4571, '2024-11-05', 379, 430, 430
                    , 430, 430, 430, 430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+379, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 379, 430, 430
                    , 430, 430, 430, 430, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+379, netSellCostBuyPrice = netSellCostBuyPrice+430
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+430
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+430
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+430
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+430
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+430
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a37b3280db and sellbillId = 143310 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:52:58";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:22:58", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:22:58', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:53:02";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:23:02", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:23:02', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:53:09";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:23:09", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:23:09', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13530');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:53:16";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:23:16", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:23:16', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13523');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:53:28";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:23:28", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:23:28', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13548');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:53:34";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:23:34", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:23:34', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13553');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:53:40";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:23:40", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:23:40', '77', 'update', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=update');
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 13553;
UPDATE buybill SET  buybillsysdate = '2024-11-05 17:23:40', userid = '77',delbyuserid = '77', conditions = '1' WHERE buybillid = '13553';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-31 14:20:05', 1, 15659, 0, 0
                    , 410, 20, 0, 0, 77, '2024-11-05 17:23:40')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:23:40' ;
UPDATE product SET productName = 'R3246', productDescription = '', productCatId = '1', productBuyPrice = '410.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '0', parcode = 'R3246',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '24.39' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',barcodeInTax='',productNameE='',partNumber='0',vehicleType='-1',company='-1',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15659';
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 15659;
UPDATE storedetail SET  productquantity = '-8', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15658';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15659', '1', '20', '1', '13553', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '12', '-8', '77', '2024-10-31 14:20:05','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-31 14:20:05', 1, 15581, 0, 0
                    , 110, 15, 0, 0, 77, '2024-11-05 17:23:40')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:23:40' ;
UPDATE product SET productName = 'R3241', productDescription = '', productCatId = '1', productBuyPrice = '110.00', productSellAllPrice = '165.00', productSellUnitPrice = '165.00', productSellHalfPrice = '165.00', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3241',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '110',lastbuyprice_withDiscount = '110',meanbuyprice = '113',meanbuyprice_withDiscount = '113' , productbuypricereal = '120.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='113.33',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='110',meanbuyprice_withTax='57',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15581';
UPDATE productunit SET proUnitBuyPrice  = 110 * productnumber WHERE productid = 15581;
UPDATE storedetail SET  productquantity = '9', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15581', '1', '15', '1', '13553', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '9', '77', '2024-10-31 14:20:05','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-31 14:20:05', 1, 15692, 0, 0
                    , 240, 15, 0, 0, 77, '2024-11-05 17:23:40')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:23:40' ;
UPDATE product SET productName = '6880', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '06880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15692';
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15692;
UPDATE storedetail SET  productquantity = '20', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '15', '1', '13553', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '35', '20', '77', '2024-10-31 14:20:05','0','0');
UPDATE supplier SET  suppliercurrentDebt = '319650',suppliercurrentDebtInCurrency= '319650' , userid = '77', supplierdate = '2024-11-05 17:23:40'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '333100.00', '13450.00', '1', 'حذف فاتورة مشتريات - للتعديل', '13553', '319650', '2024-10-31 14:20:05', '77', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','13450','1','333100','13450','319650','0');
UPDATE productserial SET del = 1
		 WHERE billid = 13553;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672367e5eb21e', '2024-10-31 14:20:37', '175', '319650.00', '331900', '0', '0', '12250', '12250', '0.00', '12250', '1', '2024-11-05 17:23:40', '', '77', '0', '', '1', '1','1','13553','buyBillController.php','0.00','-1','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3246', '13622', '1', '15659', '20.00', '410', '8200', '0.00', '', '2024-11-05 17:23:40', '15659','','','0','0','0','0','0',null,'410','8200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-31 14:20:37', 1, 15659, 0, 0
                    , 410, 20, 0, 0, 77, '2024-11-05 17:23:40')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:23:40' ;
UPDATE product SET  productBuyPrice = "410" WHERE productId = 15659 ;
UPDATE buybilldetail SET  quantitybefore = -8 WHERE buybilldetailid = 31377 ;
UPDATE product SET productName = 'R3246', productDescription = '', productCatId = '1', productBuyPrice = '410.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '0', parcode = 'R3246',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '24.39' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',barcodeInTax='',productNameE='',partNumber='0',vehicleType='-1',company='-1',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410'  WHERE productId = '15659';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 31377;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 15659;
UPDATE storedetail SET  productquantity = '12', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15658';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15659', '1', '20', '0', '13622', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-8', '12', '77', '2024-10-31 14:20:37','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3241', '13622', '1', '15581', '15.00', '110', '1650', '0.00', '', '2024-11-05 17:23:40', '15581','','','0','0','0','0','0',null,'110','1650','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-31 14:20:37', 1, 15581, 0, 0
                    , 110, 15, 0, 0, 77, '2024-11-05 17:23:40')
                ON DUPLICATE KEY UPDATE buyprice = 110,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:23:40' ;
UPDATE product SET  productBuyPrice = "110" WHERE productId = 15581 ;
UPDATE buybilldetail SET  quantitybefore = 9 WHERE buybilldetailid = 31378 ;
UPDATE product SET productName = 'R3241', productDescription = '', productCatId = '1', productBuyPrice = '110.00', productSellAllPrice = '165.00', productSellUnitPrice = '165.00', productSellHalfPrice = '165.00', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3241',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '110',lastbuyprice_withDiscount = '110',meanbuyprice = '112',meanbuyprice_withDiscount = '112' , productbuypricereal = '120.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='113.33',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='110',meanbuyprice_withTax='77',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='110'  WHERE productId = '15581';
UPDATE buybilldetail SET  lastbuyprice = 110 , meanbuyprice = 112, lastbuyprice_withDiscount = 110, meanbuyprice_withDiscount = 112
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 77, lastbuyprice_withDiscountAndTax = 110
                where buybilldetailid = 31378;
UPDATE productunit SET proUnitBuyPrice  = 110 * productnumber WHERE productid = 15581;
UPDATE storedetail SET  productquantity = '24', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15581', '1', '15', '0', '13622', 'اضافة فاتورة مشتريات', 'buyBillController.php', '9', '24', '77', '2024-10-31 14:20:37','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06880', '13622', '5', '15692', '10', '240', '2400', '0.00', '', '2024-11-05 17:23:40', '15692','','','0','0','0','0','0',null,'240','2400','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-31 14:20:37', 1, 15692, 0, 0
                    , 240, 10, 0, 0, 77, '2024-11-05 17:23:40')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:23:40' ;
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15692 ;
UPDATE buybilldetail SET  quantitybefore = 20 WHERE buybilldetailid = 31379 ;
UPDATE product SET productName = '6880', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '06880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15692';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 240, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 240
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31379;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15692;
UPDATE storedetail SET  productquantity = '30', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '10', '0', '13622', 'اضافة فاتورة مشتريات', 'buyBillController.php', '20', '30', '77', '2024-10-31 14:20:37','0','0');
DELETE FROM productserial WHERE billid = 13553
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '331900',suppliercurrentDebtInCurrency= '331900' , userid = '77', supplierdate = '2024-11-05 17:23:40'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '319650.00', '12250', '0', 'اضافة فاتورة مشتريات', '13622', '331900', '2024-11-05 17:23:40', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','13450','1','319650','12250','331900','0');
update buybill set dailyentryid='0,' where buybillid=13622;
UPDATE product SET overAllAveragePrice = 113.33 WHERE productId = 15581;UPDATE product SET overAllAveragePrice = 410 WHERE productId = 15659;UPDATE product SET overAllAveragePrice = 240 WHERE productId = 15692;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:53:41";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:23:41", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:23:41', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13622');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:54:59";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:24:59", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:24:59', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:55:07";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:25:07", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:25:07', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:55:22";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:25:22", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:25:22', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13505');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:55:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:25:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:25:55', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3852c350f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9143,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:22:58', '0672a3852c350f', '9143', '0.00', '1535', '0', '1', '1535.00', '1535', '0', '1535', '1', '2024-11-05 17:25:56', '', '75', '0', 'روان ياسر w721', '2', '1', '3', '83', 'روان ياسر w721', '6' ,'0','','','','','-1','0','0','0','0','0','1535','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1535', userid = '75' WHERE clientid = '9143';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9143','0.00','1535','0','اضافة فاتورة مبيعات','143311', '1535', '2024-11-05 17:25:56', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1535', '0', null, '0', null, null,'', '0','1','1','1535','1','2024-11-05 17:22:58','0','0');
UPDATE client SET  inUse = 0 where clientid = 9143;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34291;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','H1341', '143311', '14', '15439', '1', '580', '580', '0', '', '1', '2024-11-05 17:25:56', '15439', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34291-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        
                where sellbilldetailid = 523874;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15439, '2024-11-05', 580, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 510, 510
                    , 510, 510, 510, 510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+510
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 17:25:56' WHERE storedetailid = '15438';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15439', '1', '1', '1', '143311', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 17:25:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26428;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('425','05395', '143311', '5', '11770', '1', '365', '365', '0', '', '1', '2024-11-05 17:25:56', '11770', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26428-1,','1','1','0','0','365','365','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 706.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 706.00
        
                where sellbilldetailid = 523875;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11770, '2024-11-05', 365, 425, 425
                    , 706, 425, 706, 422.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+365, sellCostBuyPrice =sellCostBuyPrice+425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+706
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+706
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+422.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 365, 425, 425
                    , 706, 425, 706, 422.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+365, sellCostBuyPrice =sellCostBuyPrice+425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+706
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+706
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+422.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 17:25:56' WHERE storedetailid = '11769';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11770', '1', '1', '1', '143311', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 17:25:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143311', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-05 17:25:56', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523876;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '43', userid = '75', storedetaildate = '2024-11-05 17:25:56' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143311', 'اضافة فاتورة مبيعات', 'sellbillController.php', '44', '43', '75', '2024-11-05 17:25:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30701;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','B1248', '143311', '2', '13807', '1', '285', '285', '0', '', '1', '2024-11-05 17:25:56', '13807', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30701-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 1600.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 1600.00
        
                where sellbilldetailid = 523877;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13807, '2024-11-05', 285, 400, 400
                    , 1600, 400, 1600, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285, 400, 400
                    , 1600, 400, 1600, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-5', userid = '75', storedetaildate = '2024-11-05 17:25:56' WHERE storedetailid = '13806';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13807', '1', '1', '1', '143311', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-4', '-5', '75', '2024-11-05 17:25:56','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143311', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:25:56', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143311', '17', '10291', '1', '15', '15', '0', '', '1', '2024-11-05 17:25:56', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 9143;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1535, 1555, 1555
                    , 3036, 1555, 3036, 1552.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1535, sellCostBuyPrice =sellCostBuyPrice+1555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3036
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3036
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1552.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9143, '2024-11-05', 1535, 1555, 1555
                    , 3036, 1555, 3036, 1552.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1535, sellCostBuyPrice =sellCostBuyPrice+1555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3036
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3036
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1552.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1535, 1555, 1555
                    , 3036, 1555, 3036, 1552.5, 220, 220)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1535, netSellCostBuyPrice = netSellCostBuyPrice+1555
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1555
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3036
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1555
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3036
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1552.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+220;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3852c350f and sellbillId = 143311 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:55:56";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:25:56", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:25:56', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:56:42";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:26:42", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 17:26:42', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:56:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:26:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:26:43', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:57:03";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:27:03", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 17:27:03', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:57:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:27:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:27:14', '77', 'update', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=update');
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 13505;
UPDATE buybill SET  buybillsysdate = '2024-11-05 17:27:14', userid = '77',delbyuserid = '77', conditions = '1' WHERE buybillid = '13505';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:40:40', 1, 15580, 0, 0
                    , 110, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET productName = 'R3237', productDescription = '', productCatId = '1', productBuyPrice = '110.00', productSellAllPrice = '165.00', productSellUnitPrice = '165.00', productSellHalfPrice = '165.00', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3237',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '120',lastbuyprice_withDiscount = '120',meanbuyprice = '110.00',meanbuyprice_withDiscount = '110' , productbuypricereal = '110.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='115',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='120',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15580';
UPDATE productunit SET proUnitBuyPrice  = 120 * productnumber WHERE productid = 15580;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15579';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15580', '1', '15', '1', '13505', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-10-26 12:40:40','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:40:40', 1, 15499, 0, 0
                    , 430, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET productName = 'R3223', productDescription = '', productCatId = '1', productBuyPrice = '430.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2024-10-16', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3223',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='395',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15499';
UPDATE productunit SET proUnitBuyPrice  = 430 * productnumber WHERE productid = 15499;
UPDATE storedetail SET  productquantity = '14', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15498';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15499', '1', '15', '1', '13505', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '29', '14', '77', '2024-10-26 12:40:40','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:40:40', 1, 15489, 0, 0
                    , 110, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET productName = 'R3219', productDescription = '', productCatId = '1', productBuyPrice = '110.00', productSellAllPrice = '165.00', productSellUnitPrice = '165.00', productSellHalfPrice = '165.00', productDate = '2024-10-15', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3219',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '110',lastbuyprice_withDiscount = '110',meanbuyprice = '110',meanbuyprice_withDiscount = '110' , productbuypricereal = '110.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='110',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='110',meanbuyprice_withTax='33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15489';
UPDATE productunit SET proUnitBuyPrice  = 110 * productnumber WHERE productid = 15489;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15488';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15489', '1', '15', '1', '13505', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '25', '10', '77', '2024-10-26 12:40:40','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:40:40', 1, 15629, 0, 0
                    , 400, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE buybilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400.00, meanbuyprice_withTax = 400.00, lastbuyprice_withDiscountAndTax = 400.00
                where buybilldetailid = 31050;
UPDATE product SET productName = '6850', productDescription = '', productCatId = '5', productBuyPrice = '400.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2024-10-23', conditions = '0', userId = '77', limitamount = '0', parcode = '56910',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '0',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',barcodeInTax='',productNameE='',partNumber='0',vehicleType='-1',company='-1',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15629';
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 15629;
UPDATE storedetail SET  productquantity = '-8', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15629', '1', '15', '1', '13505', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '7', '-8', '77', '2024-10-26 12:40:40','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:40:40', 1, 15509, 0, 0
                    , 235, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET productName = '6826', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-10-16', conditions = '0', userId = '77', limitamount = '1', parcode = '06826',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '180.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='134',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15509';
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 15509;
UPDATE storedetail SET  productquantity = '9', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15508';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15509', '1', '15', '1', '13505', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '9', '77', '2024-10-26 12:40:40','0','0');
UPDATE supplier SET  suppliercurrentDebt = '312625',suppliercurrentDebtInCurrency= '312625' , userid = '77', supplierdate = '2024-11-05 17:27:14'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '331900.00', '19275.00', '1', 'حذف فاتورة مشتريات - للتعديل', '13505', '312625', '2024-10-26 12:40:40', '77', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','19275','1','331900','19275','312625','0');
UPDATE productserial SET del = 1
		 WHERE billid = 13505;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0671cb918ccbc5', '2024-10-26 12:42:45', '175', '312625.00', '334050', '0', '0', '21425', '21425', '0.00', '21425', '1', '2024-11-05 17:27:14', '', '77', '0', '', '1', '1','1','13505','buyBillController.php','0.00','-1','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3237', '13623', '1', '15580', '15.00', '110', '1650', '0.00', '', '2024-11-05 17:27:14', '15580','','','0','0','0','0','0',null,'110','1650','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:42:45', 1, 15580, 0, 0
                    , 110, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyprice = 110,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET  productBuyPrice = "110" WHERE productId = 15580 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31380 ;
UPDATE product SET productName = 'R3237', productDescription = '', productCatId = '1', productBuyPrice = '110.00', productSellAllPrice = '165.00', productSellUnitPrice = '165.00', productSellHalfPrice = '165.00', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3237',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '110',lastbuyprice_withDiscount = '110',meanbuyprice = '110',meanbuyprice_withDiscount = '110' , productbuypricereal = '110.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='115',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='110',meanbuyprice_withTax='55',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='110'  WHERE productId = '15580';
UPDATE buybilldetail SET  lastbuyprice = 110 , meanbuyprice = 110, lastbuyprice_withDiscount = 110, meanbuyprice_withDiscount = 110
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 55, lastbuyprice_withDiscountAndTax = 110
                where buybilldetailid = 31380;
UPDATE productunit SET proUnitBuyPrice  = 110 * productnumber WHERE productid = 15580;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15579';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15580', '1', '15', '0', '13623', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-10-26 12:42:45','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3223', '13623', '1', '15499', '20', '430', '8600', '0.00', '', '2024-11-05 17:27:14', '15499','','','0','0','0','0','0',null,'430','8600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:42:45', 1, 15499, 0, 0
                    , 430, 20, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyprice = 430,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET  productBuyPrice = "430" WHERE productId = 15499 ;
UPDATE buybilldetail SET  quantitybefore = 14 WHERE buybilldetailid = 31381 ;
UPDATE product SET productName = 'R3223', productDescription = '', productCatId = '1', productBuyPrice = '430.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2024-10-16', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3223',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='409',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430'  WHERE productId = '15499';
UPDATE buybilldetail SET  lastbuyprice = 430 , meanbuyprice = 430, lastbuyprice_withDiscount = 430, meanbuyprice_withDiscount = 430
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 409, lastbuyprice_withDiscountAndTax = 430
                where buybilldetailid = 31381;
UPDATE productunit SET proUnitBuyPrice  = 430 * productnumber WHERE productid = 15499;
UPDATE storedetail SET  productquantity = '34', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15498';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15499', '1', '20', '0', '13623', 'اضافة فاتورة مشتريات', 'buyBillController.php', '14', '34', '77', '2024-10-26 12:42:45','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3219', '13623', '1', '15489', '15.00', '110', '1650', '0.00', '', '2024-11-05 17:27:14', '15489','','','0','0','0','0','0',null,'110','1650','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:42:45', 1, 15489, 0, 0
                    , 110, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyprice = 110,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET  productBuyPrice = "110" WHERE productId = 15489 ;
UPDATE buybilldetail SET  quantitybefore = 10 WHERE buybilldetailid = 31382 ;
UPDATE product SET productName = 'R3219', productDescription = '', productCatId = '1', productBuyPrice = '110.00', productSellAllPrice = '165.00', productSellUnitPrice = '165.00', productSellHalfPrice = '165.00', productDate = '2024-10-15', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3219',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '110',lastbuyprice_withDiscount = '110',meanbuyprice = '110',meanbuyprice_withDiscount = '110' , productbuypricereal = '110.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='110',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='110',meanbuyprice_withTax='62',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='110'  WHERE productId = '15489';
UPDATE buybilldetail SET  lastbuyprice = 110 , meanbuyprice = 110, lastbuyprice_withDiscount = 110, meanbuyprice_withDiscount = 110
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 62, lastbuyprice_withDiscountAndTax = 110
                where buybilldetailid = 31382;
UPDATE productunit SET proUnitBuyPrice  = 110 * productnumber WHERE productid = 15489;
UPDATE storedetail SET  productquantity = '25', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15488';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15489', '1', '15', '0', '13623', 'اضافة فاتورة مشتريات', 'buyBillController.php', '10', '25', '77', '2024-10-26 12:42:45','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('56910', '13623', '5', '15629', '15.00', '400', '6000', '0.00', '', '2024-11-05 17:27:14', '15629','','','0','0','0','0','0',null,'400','6000','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:42:45', 1, 15629, 0, 0
                    , 400, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyprice = 400,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET  productBuyPrice = "400" WHERE productId = 15629 ;
UPDATE buybilldetail SET  quantitybefore = -8 WHERE buybilldetailid = 31383 ;
UPDATE product SET productName = '6850', productDescription = '', productCatId = '5', productBuyPrice = '400.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2024-10-23', conditions = '0', userId = '77', limitamount = '0', parcode = '56910',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',barcodeInTax='',productNameE='',partNumber='0',vehicleType='-1',company='-1',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400'  WHERE productId = '15629';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 400, meanbuyprice_withDiscount = 400
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where buybilldetailid = 31383;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 15629;
UPDATE storedetail SET  productquantity = '7', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15629', '1', '15', '0', '13623', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-8', '7', '77', '2024-10-26 12:42:45','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06826', '13623', '5', '15509', '15.00', '235', '3525', '0.00', '', '2024-11-05 17:27:14', '15509','','','0','0','0','0','0',null,'235','3525','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-26 12:42:45', 1, 15509, 0, 0
                    , 235, 15, 0, 0, 77, '2024-11-05 17:27:14')
                ON DUPLICATE KEY UPDATE buyprice = 235,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:27:14' ;
UPDATE product SET  productBuyPrice = "235" WHERE productId = 15509 ;
UPDATE buybilldetail SET  quantitybefore = 9 WHERE buybilldetailid = 31384 ;
UPDATE product SET productName = '6826', productDescription = '', productCatId = '5', productBuyPrice = '235.00', productSellAllPrice = '240.00', productSellUnitPrice = '240.00', productSellHalfPrice = '240.00', productDate = '2024-10-16', conditions = '0', userId = '77', limitamount = '1', parcode = '06826',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '180.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='173',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='235'  WHERE productId = '15509';
UPDATE buybilldetail SET  lastbuyprice = 235 , meanbuyprice = 235, lastbuyprice_withDiscount = 235, meanbuyprice_withDiscount = 235
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 173, lastbuyprice_withDiscountAndTax = 235
                where buybilldetailid = 31384;
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 15509;
UPDATE storedetail SET  productquantity = '24', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15508';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15509', '1', '15', '0', '13623', 'اضافة فاتورة مشتريات', 'buyBillController.php', '9', '24', '77', '2024-10-26 12:42:45','0','0');
DELETE FROM productserial WHERE billid = 13505
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '334050',suppliercurrentDebtInCurrency= '334050' , userid = '77', supplierdate = '2024-11-05 17:27:14'   WHERE supplierid = '175';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('175', '312625.00', '21425', '0', 'اضافة فاتورة مشتريات', '13623', '334050', '2024-11-05 17:27:14', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','19275','1','312625','21425','334050','0');
update buybill set dailyentryid='0,' where buybillid=13623;
UPDATE product SET overAllAveragePrice = 110 WHERE productId = 15489;UPDATE product SET overAllAveragePrice = 430 WHERE productId = 15499;UPDATE product SET overAllAveragePrice = 235 WHERE productId = 15509;UPDATE product SET overAllAveragePrice = 115 WHERE productId = 15580;UPDATE product SET overAllAveragePrice = 400 WHERE productId = 15629;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:57:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:27:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:27:15', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13623');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:57:18";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:27:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:27:18', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:57:24";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:27:24", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:27:24', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:58:31";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:28:31", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:28:31', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a39050b409
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8334,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:25:57', '0672a39050b409', '8334', '1328.00', '1631', '0', '1', '303.00', '303', '0', '303', '1', '2024-11-05 17:28:31', '', '75', '0', 'ياسمين احمد امينI600', '2', '1', '3', '81', 'ياسمين احمد امينI600', '2' ,'0','','','','','-1','0','0','0','0','0','303','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1631', userid = '75' WHERE clientid = '8334';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8334','1328.00','303','0','اضافة فاتورة مبيعات','143312', '1631', '2024-11-05 17:28:31', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '303', '0', null, '0', null, null,'', '0','1','1','303','1','2024-11-05 17:25:57','0','0');
UPDATE client SET  inUse = 0 where clientid = 8334;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34730;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','0K787', '143312', '7', '15764', '1', '300', '300', '0', '', '1', '2024-11-05 17:28:31', '15764', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34730-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523880;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15764, '2024-11-05', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '75', storedetaildate = '2024-11-05 17:28:31' WHERE storedetailid = '15763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15764', '1', '1', '1', '143312', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '75', '2024-11-05 17:28:31','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143312', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 17:28:31', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 8334;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 303, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8334, '2024-11-05', 303, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 303, 230, 230
                    , 230, 230, 230, 230, 230, 115)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+303, netSellCostBuyPrice = netSellCostBuyPrice+230
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+230
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+230
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+230
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+230
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+230
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+230
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+115;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a39050b409 and sellbillId = 143312 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:58:31";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:28:31", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:28:31', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:59:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:29:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:29:13', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:59:17";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:29:17", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:29:17', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13621');
UPDATE productunit SET unitid = '1', productid = '15749', productnumber = '1.00', productunitdate = '2024-10-29', userid = '77', conditions = '0',proUnitParcode='1574901',proUnitSellAllPrice='550',proUnitSellHalfPrice='550',proUnitSellUnitPrice ='550',proUnitBuyPrice='450',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15749';
UPDATE product SET productName = 'H1421', productDescription = '', productCatId = '14', productBuyPrice = '455', productSellAllPrice = '550', productSellUnitPrice = '550', productSellHalfPrice = '550', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1421',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '450',meanbuyprice = '452.5',meanbuyprice_withDiscount = '452.5' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='450',meanbuyprice_withTax='450',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='450'  WHERE productId = '15749';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:59:43";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:29:43", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:29:43', '77', 'update', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=update');
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 13621;
UPDATE buybill SET  buybillsysdate = '2024-11-05 17:29:43', userid = '77',delbyuserid = '77', conditions = '1' WHERE buybillid = '13621';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:53:00', 1, 15597, 0, 0
                    , 460, 10, 0, 0, 77, '2024-11-05 17:29:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:29:44' ;
UPDATE product SET productName = 'H1393', productDescription = '', productCatId = '14', productBuyPrice = '460.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1393',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15597';
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 15597;
UPDATE storedetail SET  productquantity = '7', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15597', '1', '10', '1', '13621', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '17', '7', '77', '2024-11-05 16:53:00','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:53:00', 1, 15872, 0, 0
                    , 455, 10, 0, 0, 77, '2024-11-05 17:29:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:29:44' ;
UPDATE buybilldetail SET  lastbuyprice = 455.00 , meanbuyprice = 455.00, lastbuyprice_withDiscount = 455.00, meanbuyprice_withDiscount = 455.00
        , lastbuyprice_withTax = 455.00, meanbuyprice_withTax = 455.00, lastbuyprice_withDiscountAndTax = 455.00
                where buybilldetailid = 31376;
UPDATE product SET productName = 'H1466', productDescription = '', productCatId = '14', productBuyPrice = '455.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1466',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '0',meanbuyprice = '455.00',meanbuyprice_withDiscount = '455' , productbuypricereal = '455.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='455',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15872';
UPDATE productunit SET proUnitBuyPrice  = 455 * productnumber WHERE productid = 15872;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15871';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15872', '1', '10', '1', '13621', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '10', '0', '77', '2024-11-05 16:53:00','0','0');
UPDATE supplier SET  suppliercurrentDebt = '323675',suppliercurrentDebtInCurrency= '323675' , userid = '77', supplierdate = '2024-11-05 17:29:43'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '332825.00', '9150.00', '1', 'حذف فاتورة مشتريات - للتعديل', '13621', '323675', '2024-11-05 16:53:00', '77', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','9150','1','332825','9150','323675','0');
UPDATE productserial SET del = 1
		 WHERE billid = 13621;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a314c4cc43', '2024-11-05 16:58:11', '27', '323675.00', '332825', '0', '0', '9150', '9150', '0.00', '9150', '1', '2024-11-05 17:29:43', '', '77', '0', '', '1', '1','1','13621','buyBillController.php','0.00','-1','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1393', '13624', '14', '15597', '10.00', '460', '4600', '0.00', '', '2024-11-05 17:29:43', '15597','','','0','0','0','0','0',null,'460','4600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:58:11', 1, 15597, 0, 0
                    , 460, 10, 0, 0, 77, '2024-11-05 17:29:44')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:29:44' ;
UPDATE product SET  productBuyPrice = "460" WHERE productId = 15597 ;
UPDATE buybilldetail SET  quantitybefore = 7 WHERE buybilldetailid = 31385 ;
UPDATE product SET productName = 'H1393', productDescription = '', productCatId = '14', productBuyPrice = '460.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1393',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='460'  WHERE productId = '15597';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 31385;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 15597;
UPDATE storedetail SET  productquantity = '17', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15597', '1', '10', '0', '13624', 'اضافة فاتورة مشتريات', 'buyBillController.php', '7', '17', '77', '2024-11-05 16:58:11','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1421', '13624', '14', '15749', '10', '455', '4550', '0', '', '2024-11-05 17:29:43', '15749','','','0','0','0','0','0',null,'455','4550','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 16:58:11', 1, 15749, 0, 0
                    , 455, 10, 0, 0, 77, '2024-11-05 17:29:44')
                ON DUPLICATE KEY UPDATE buyprice = 455,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:29:44' ;
UPDATE product SET  productBuyPrice = "455" WHERE productId = 15749 ;
UPDATE buybilldetail SET  quantitybefore = 6 WHERE buybilldetailid = 31386 ;
UPDATE product SET productName = 'H1421', productDescription = '', productCatId = '14', productBuyPrice = '455.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1421',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '454',meanbuyprice_withDiscount = '454' , productbuypricereal = '450.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='455',meanbuyprice_withTax='453',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='455'  WHERE productId = '15749';
UPDATE buybilldetail SET  lastbuyprice = 455 , meanbuyprice = 454, lastbuyprice_withDiscount = 455, meanbuyprice_withDiscount = 454
        , lastbuyprice_withTax = 455, meanbuyprice_withTax = 453, lastbuyprice_withDiscountAndTax = 455
                where buybilldetailid = 31386;
UPDATE productunit SET proUnitBuyPrice  = 455 * productnumber WHERE productid = 15749;
UPDATE storedetail SET  productquantity = '16', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15748';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15749', '1', '10', '0', '13624', 'اضافة فاتورة مشتريات', 'buyBillController.php', '6', '16', '77', '2024-11-05 16:58:11','0','0');
DELETE FROM productserial WHERE billid = 13621
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '332825',suppliercurrentDebtInCurrency= '332825' , userid = '77', supplierdate = '2024-11-05 17:29:43'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '323675.00', '9150', '0', 'اضافة فاتورة مشتريات', '13624', '332825', '2024-11-05 17:29:43', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','9150','1','323675','9150','332825','0');
update buybill set dailyentryid='0,' where buybillid=13624;
UPDATE product SET overAllAveragePrice = 460 WHERE productId = 15597;UPDATE product SET overAllAveragePrice = 452.5 WHERE productId = 15749;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:59:44";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:29:44", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:29:44', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13624');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 13:59:53";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:29:53", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:29:53', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13624&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:00:47";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:30:47", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:30:47', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:00:51";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:30:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:30:51', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:00:55";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:30:55", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:30:55', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:01:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:31:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:31:02', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:01:32";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:31:32", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:31:32', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a31175fd90
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6741,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 16:52:07', '0672a31175fd90', '6741', '0.00', '1000', '0', '1', '1000.00', '1000', '0', '1000', '1', '2024-11-05 17:31:32', '', '75', '0', 'اسماء مجدي دمنهور 33', '2', '1', '3', '89', 'اسماء مجدي دمنهور 33', '3' ,'0','','','','','-1','0','0','0','0','0','1000','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1000', userid = '75' WHERE clientid = '6741';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6741','0.00','1000','0','اضافة فاتورة مبيعات','143313', '1000', '2024-11-05 17:31:32', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1000', '0', null, '0', null, null,'', '0','1','1','1000','1','2024-11-05 16:52:07','0','0');
UPDATE client SET  inUse = 0 where clientid = 6741;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34459;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('830','H1391', '143313', '14', '15598', '1', '970', '970', '0', '', '1', '2024-11-05 17:31:32', '15598', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34459-1,','1','1','0','0','970','970','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 830.00 , meanbuyprice = 1092.00, lastbuyprice_withDiscount = 830.00, meanbuyprice_withDiscount = 1092.00
        , lastbuyprice_withTax = 830, meanbuyprice_withTax = 877
                where sellbilldetailid = 523882;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15598, '2024-11-05', 970, 830, 830
                    , 1092, 830, 1092, 615
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 830, 877, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+970, sellCostBuyPrice =sellCostBuyPrice+830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+615
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+877
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 970, 830, 830
                    , 1092, 830, 1092, 615
                    , 0, 0, 0, 0
                    , 0, 0, 0, 830, 877, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+970, sellCostBuyPrice =sellCostBuyPrice+830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+615
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+877
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 17:31:32' WHERE storedetailid = '15597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15598', '1', '1', '1', '143313', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 17:31:32','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143313', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:31:32', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143313', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-05 17:31:32', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 6741;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1000, 830, 830
                    , 1092, 830, 1092, 615
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,830, 877, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+615
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+877
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6741, '2024-11-05', 1000, 830, 830
                    , 1092, 830, 1092, 615
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,830, 877, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+615
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+877
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1000, 830, 830
                    , 1092, 830, 1092, 615, 830, 877)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1000, netSellCostBuyPrice = netSellCostBuyPrice+830
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+830
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1092
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+830
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1092
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+615
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+830
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+877;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a31175fd90 and sellbillId = 143313 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:01:33";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:31:33", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:31:33', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:01:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:31:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:31:46', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143222');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:02:12";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:32:12", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:32:12', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:02:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:32:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:32:45', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143222 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143222 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143222;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 17:32:45', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143222';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34435;
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523505;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14358, '2024-11-05', 120, 150, 150
                    , 150, 150, 150, 148.75
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-120, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-148.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 120, 150, 150
                    , 150, 150, 150, 148.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-120, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-148.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 17:32:45' WHERE storedetailid = '14357';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14358', '1', '1', '0', '143222', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7', '8', '2', '2024-11-05 13:51:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 32480;
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523506;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14610, '2024-11-05', 145, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-145, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 145, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-145, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 17:32:45' WHERE storedetailid = '14609';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14610', '1', '1', '0', '143222', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '2', '2024-11-05 13:51:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 30203;
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523507;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13267, '2024-11-05', 870, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-870, sellCostBuyPrice =sellCostBuyPrice-660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-660, sellCostMeanBuyPrice = sellCostMeanBuyPrice-660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-3
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 870, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-870, sellCostBuyPrice =sellCostBuyPrice-660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-660, sellCostMeanBuyPrice = sellCostMeanBuyPrice-660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 17:32:45' WHERE storedetailid = '13266';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13267', '1', '3', '0', '143222', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '8', '2', '2024-11-05 13:51:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 32514;
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523508;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14635, '2024-11-05', 210, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-210, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-210, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-05 17:32:45' WHERE storedetailid = '14634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14635', '1', '1', '0', '143222', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '7', '2', '2024-11-05 13:51:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 29501;
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        
                where sellbilldetailid = 523509;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13192, '2024-11-05', 195, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-245, sellCostMeanBuyPrice = sellCostMeanBuyPrice-245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 195, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-245, sellCostMeanBuyPrice = sellCostMeanBuyPrice-245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 17:32:45' WHERE storedetailid = '13191';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13192', '1', '1', '0', '143222', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '2', '2024-11-05 13:51:48','0','0');
CALL clientInUse(235,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-870', userid = '2' WHERE clientid = '235';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('235','706.00','1576.00','1','تعديل فاتورة مبيعات','143222', '-870', '2024-11-05 13:51:48', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '1576', '0', null, '0', null, null,'', '0','1','1','1576','1','2024-11-05 13:51:48','0','0');
UPDATE client SET  inUse = 0 where clientid = 235;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1576, 1440, 1440
                    , 1440, 1440, 1440, 1438.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1576, sellCostBuyPrice =sellCostBuyPrice-1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1438.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (235, '2024-11-05', 1576, 1440, 1440
                    , 1440, 1440, 1440, 1438.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1576, sellCostBuyPrice =sellCostBuyPrice-1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1438.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1576, 1440, 1440
                    , 1440, 1440, 1440, 1438.75, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-1576, netSellCostBuyPrice = netSellCostBuyPrice-1440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1440
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1440
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1438.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143222 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143222 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(235,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 13:51:48', '0672a06d4719d5', '235', '-870.00', '-7', '0', '1', '863', '863', '0', '863', '1', '2024-11-05 13:51:48', '', '2', '0', 'لمياء حداد i71', '2', '1', '3', '81', 'لمياء حداد i71', '8', '143222', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '-7', userid = '2' WHERE clientid = '235';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('235','-870.00','863','0','اضافة فاتورة مبيعات (معدله)','143314', '-7', '2024-11-05 17:32:45', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '863', '0', null, '0', null, null,'', '0','1','1','1576','1','2024-11-05 13:51:48','0','0');
UPDATE client SET  inUse = 0 where clientid = 235;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34435;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06311', '143314', '5', '14358', '1', '120', '120', '0', '', '1', '2024-11-05 17:32:46', '14358', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34435-1,','1','1','0','0','120','120','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523885;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14358, '2024-11-05', 120, 150, 150
                    , 150, 150, 150, 148.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+148.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 120, 150, 150
                    , 150, 150, 150, 148.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+148.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-05 17:32:46' WHERE storedetailid = '14357';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14358', '1', '1', '1', '143314', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '7', '2', '2024-11-05 17:32:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32480;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06416', '143314', '5', '14610', '1', '145', '145', '0', '', '1', '2024-11-05 17:32:46', '14610', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32480-1,','1','1','0','0','145','145','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 523886;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14610, '2024-11-05', 145, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 145, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+145, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-05 17:32:46' WHERE storedetailid = '14609';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14610', '1', '1', '1', '143314', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '2', '2024-11-05 17:32:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 30203;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2707', '143314', '1', '13267', '3', '120', '360', '0', '', '1', '2024-11-05 17:32:46', '13267', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30203-3,','1','1','0','0','120','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 523887;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13267, '2024-11-05', 360, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 360, 660, 660
                    , 660, 660, 660, 660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 17:32:46' WHERE storedetailid = '13266';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13267', '1', '3', '1', '143314', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '5', '2', '2024-11-05 17:32:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32514;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06430', '143314', '5', '14635', '1', '210', '210', '0', '', '1', '2024-11-05 17:32:46', '14635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32514-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523888;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14635, '2024-11-05', 210, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 17:32:46' WHERE storedetailid = '14634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14635', '1', '1', '1', '143314', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '7', '6', '2', '2024-11-05 17:32:46','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143314', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:32:46', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143314', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-05 17:32:46', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 863, 1195, 1195
                    , 1195, 1195, 1195, 1193.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+863, sellCostBuyPrice =sellCostBuyPrice+1195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1193.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (235, '2024-11-05', 863, 1195, 1195
                    , 1195, 1195, 1195, 1193.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+863, sellCostBuyPrice =sellCostBuyPrice+1195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1193.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 863, 1195, 1195
                    , 1195, 1195, 1195, 1193.75, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+863, netSellCostBuyPrice = netSellCostBuyPrice+1195
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1195
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1195
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1195
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1195
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1193.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143222 and newid=143314 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:02:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:32:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:32:46', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143314');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6950','','5','520','600', '600','600', '2024-11-05', '0', '77', '1', '06950', '0', '0', '0', '0', '0', '520','520','520','520','520','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','520','520','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15873, 1,'2024-11-05 17:32:51',77)
                ON DUPLICATE KEY UPDATE productid = 15873, edited = 1, sysdate = '2024-11-05 17:32:51', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15873', '1', '2024-11-05', '77', '0','1587301','600','600','600','520','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15873', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15873', '1', '0', '0', '15873', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:03:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:33:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:33:02', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:03:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:33:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:33:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a383a68748
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(637,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:22:34', '0672a383a68748', '637', '1035.00', '9420', '285', '1', '8670.00', '8385', '0', '8385', '1', '2024-11-05 17:33:10', '', '9', '0', 'فؤاد ادوار V0001', '1', '1', '3', '24', 'فؤاد ادوار V0001', '19' ,'0','','','','','-1','0','0','0','0','0','8385','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '9420', userid = '9' WHERE clientid = '637';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('637','1035.00','8385','0','اضافة فاتورة مبيعات','143315', '9420', '2024-11-05 17:33:10', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8385', '0', null, '0', null, null,'', '0','1','1','8385','1','2024-11-05 17:22:34','0','0');
UPDATE client SET  inUse = 0 where clientid = 637;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','H1408', '143315', '14', '15693', '1', '600', '600', '0', '', '1', '2024-11-05 17:33:11', '15693', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34605-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 523891;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15693, '2024-11-05', 580.276816609, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580.276816609, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580.276816609, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580.276816609, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15693', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '17', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34771;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06925', '143315', '5', '15785', '1', '350', '350', '0', '', '1', '2024-11-05 17:33:11', '15785', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34771-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 523892;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15785, '2024-11-05', 338.49480968858, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+338.49480968858, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 338.49480968858, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+338.49480968858, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15785', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34627;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','R3265', '143315', '1', '15702', '1', '380', '380', '0', '', '1', '2024-11-05 17:33:11', '15702', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34627-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 523893;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15702, '2024-11-05', 367.50865051903, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+367.50865051903, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 367.50865051903, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+367.50865051903, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15701';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15702', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34775;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06920', '143315', '5', '15788', '1', '300', '300', '0', '', '1', '2024-11-05 17:33:11', '15788', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34775-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523894;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15788, '2024-11-05', 290.1384083045, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290.1384083045, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290.1384083045, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290.1384083045, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15787';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15788', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34093;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1300', '143315', '14', '15378', '1', '380', '380', '0', '', '1', '2024-11-05 17:33:11', '15378', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34093-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 523895;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15378, '2024-11-05', 367.50865051903, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+367.50865051903, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 367.50865051903, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+367.50865051903, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15377';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15378', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29835;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('445','05955', '143315', '5', '13288', '1', '500', '500', '0', '', '1', '2024-11-05 17:33:11', '13288', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29835-1,','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 445.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 445.00
        
                where sellbilldetailid = 523896;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13288, '2024-11-05', 483.56401384083, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+483.56401384083, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 483.56401384083, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+483.56401384083, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '13287';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13288', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-05 17:33:11','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6948','','5','480','550', '550','550', '2024-11-05', '0', '77', '1', '06948', '0', '0', '0', '0', '0', '480','480','480','480','480','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','480','480','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15874, 1,'2024-11-05 17:33:11',77)
                ON DUPLICATE KEY UPDATE productid = 15874, edited = 1, sysdate = '2024-11-05 17:33:11', userid = 77;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34803;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15874', '1', '2024-11-05', '77', '0','1587401','550','550','550','480','','0','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('465','06928', '143315', '5', '15802', '1', '520', '520', '0', '', '1', '2024-11-05 17:33:11', '15802', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34803-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15874', '1', '0', '77', '2024-11-05');
UPDATE sellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 465.00, meanbuyprice_withDiscount = 465.00
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 465, lastbuyprice_withDiscountAndTax = 465
                where sellbilldetailid = 523897;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15802, '2024-11-05', 502.90657439446, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+502.90657439446, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 502.90657439446, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+502.90657439446, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15801';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15874', '1', '0', '0', '15874', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15802', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34870;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('370','H1452', '143315', '14', '15839', '2', '450', '900', '0', '', '1', '2024-11-05 17:33:11', '15839', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34870-2,','1','1','0','0','450','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where sellbilldetailid = 523898;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15839, '2024-11-05', 870.41522491349, 740, 740
                    , 740, 740, 740, 740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 740, 740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+870.41522491349, sellCostBuyPrice =sellCostBuyPrice+740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 870.41522491349, 740, 740
                    , 740, 740, 740, 740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 740, 740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+870.41522491349, sellCostBuyPrice =sellCostBuyPrice+740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15838';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15839', '1', '2', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '3', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34805;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','H1449', '143315', '14', '15804', '1', '410', '410', '0', '', '1', '2024-11-05 17:33:11', '15804', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34805-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 523899;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15804, '2024-11-05', 396.52249134948, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 340, 340, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+396.52249134948, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+340
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 396.52249134948, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 340, 340, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+396.52249134948, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+340
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15803';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15804', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34611;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1357', '143315', '14', '15477', '1', '360', '360', '0', '', '1', '2024-11-05 17:33:11', '15477', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34611-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 277, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 523900;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15477, '2024-11-05', 348.1660899654, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+348.1660899654, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 348.1660899654, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+348.1660899654, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '58', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15476';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15477', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '59', '58', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34379;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','H1368', '143315', '14', '15547', '1', '620', '620', '0', '', '1', '2024-11-05 17:33:11', '15547', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34379-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 514.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 514.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 319, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 523901;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15547, '2024-11-05', 599.61937716263, 510, 510
                    , 514, 510, 514, 515
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 510, 319, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+599.61937716263, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+514
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+514
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+515
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+319
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 599.61937716263, 510, 510
                    , 514, 510, 514, 515
                    , 0, 0, 0, 0
                    , 0, 0, 0, 510, 319, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+599.61937716263, sellCostBuyPrice =sellCostBuyPrice+510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+514
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+514
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+515
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+319
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15546';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15547', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34780;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','H1414', '143315', '14', '15793', '2', '800', '1600', '0', '', '1', '2024-11-05 17:33:11', '15793', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34780-2,','1','1','0','0','800','1600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 523902;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15793, '2024-11-05', 1547.4048442907, 1160, 1160
                    , 1160, 1160, 1160, 1160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 1160, 1160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1547.4048442907, sellCostBuyPrice =sellCostBuyPrice+1160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1547.4048442907, 1160, 1160
                    , 1160, 1160, 1160, 1160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1160, 1160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1547.4048442907, sellCostBuyPrice =sellCostBuyPrice+1160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15792';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15793', '1', '2', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '6', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34704;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','R3250', '143315', '1', '15750', '1', '380', '380', '0', '', '1', '2024-11-05 17:33:11', '15750', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34704-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 523903;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15750, '2024-11-05', 367.50865051903, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+367.50865051903, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 367.50865051903, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+367.50865051903, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15749';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15750', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34723;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06913', '143315', '5', '15757', '1', '340', '340', '0', '', '1', '2024-11-05 17:33:11', '15757', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34723-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 281.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 281.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 282, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 523904;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15757, '2024-11-05', 328.82352941176, 280, 280
                    , 281, 280, 281, 282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+328.82352941176, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+281
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+281
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 328.82352941176, 280, 280
                    , 281, 280, 281, 282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+328.82352941176, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+281
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+281
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '34', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15756';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15757', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '34', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34528;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('130','06867', '143315', '5', '15642', '2', '210', '420', '0', '', '1', '2024-11-05 17:33:11', '15642', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34528-2,','1','1','0','0','210','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 130.00 , meanbuyprice = 130.00, lastbuyprice_withDiscount = 130.00, meanbuyprice_withDiscount = 130.00
        , lastbuyprice_withTax = 130, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 130
                where sellbilldetailid = 523905;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15642, '2024-11-05', 406.1937716263, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+406.1937716263, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 406.1937716263, 260, 260
                    , 260, 260, 260, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+406.1937716263, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '45', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15641';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15642', '1', '2', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '47', '45', '9', '2024-11-05 17:33:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34487;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','H1379', '143315', '14', '15622', '1', '610', '610', '0', '', '1', '2024-11-05 17:33:11', '15622', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34487-1,','1','1','0','0','610','610','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523906;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15622, '2024-11-05', 589.94809688581, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+589.94809688581, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 589.94809688581, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+589.94809688581, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 17:33:11' WHERE storedetailid = '15621';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15622', '1', '1', '1', '143315', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 17:33:11','0','0');
UPDATE client SET  delegateid = 24 where clientid = 637;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 8385, 6825, 6825
                    , 6825, 6825, 6825, 6822.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6080, 5858, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8385, sellCostBuyPrice =sellCostBuyPrice+6825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6822.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5858
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (637, '2024-11-05', 8385, 6825, 6825
                    , 6825, 6825, 6825, 6822.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6080, 5858, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8385, sellCostBuyPrice =sellCostBuyPrice+6825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6822.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5858
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 8385, 6825, 6825
                    , 6825, 6825, 6825, 6822.5, 6080, 5858)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8385, netSellCostBuyPrice = netSellCostBuyPrice+6825
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6825
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6825
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6825
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6825
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6822.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6080
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5858;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a383a68748 and sellbillId = 143315 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:03:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:33:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:33:12', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:03:12";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:33:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:33:12', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6947','','5','495','550', '550','550', '2024-11-05', '0', '77', '1', '06947', '0', '0', '0', '0', '0', '495','495','495','495','495','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','495','495','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15875, 1,'2024-11-05 17:33:38',77)
                ON DUPLICATE KEY UPDATE productid = 15875, edited = 1, sysdate = '2024-11-05 17:33:38', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15875', '1', '2024-11-05', '77', '0','1587501','550','550','550','495','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15875', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15875', '1', '0', '0', '15875', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:03:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:33:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:33:45', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:03:54";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:33:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:33:54', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3a55b4415
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2665,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:31:33', '0672a3a55b4415', '2665', '15.00', '1313', '0', '1', '1298.00', '1298', '0', '1298', '1', '2024-11-05 17:33:54', '', '75', '0', 'منة حمدي u730', '2', '1', '3', '91', 'منة حمدي u730', '5' ,'0','','','','','-1','0','0','0','0','0','1298','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1313', userid = '75' WHERE clientid = '2665';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2665','15.00','1298','0','اضافة فاتورة مبيعات','143316', '1313', '2024-11-05 17:33:54', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1298', '0', null, '0', null, null,'', '0','1','1','1298','1','2024-11-05 17:31:33','0','0');
UPDATE client SET  inUse = 0 where clientid = 2665;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34758;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','H1444', '143316', '14', '15782', '1', '500', '500', '0', '', '1', '2024-11-05 17:33:55', '15782', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34758-1,','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 523907;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15782, '2024-11-05', 500, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 17:33:55' WHERE storedetailid = '15781';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15782', '1', '1', '1', '143316', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 17:33:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34455;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('385','H1388', '143316', '14', '15595', '1', '465', '465', '0', '', '1', '2024-11-05 17:33:55', '15595', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34455-1,','1','1','0','0','465','465','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where sellbilldetailid = 523908;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15595, '2024-11-05', 465, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 385, 385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+385
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 465, 385, 385
                    , 385, 385, 385, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 385, 385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+385
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 17:33:55' WHERE storedetailid = '15594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15595', '1', '1', '1', '143316', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 17:33:55','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34789;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06880', '143316', '5', '15692', '1', '300', '300', '0', '', '1', '2024-11-05 17:33:55', '15692', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34789-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523909;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15692, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-05 17:33:55' WHERE storedetailid = '15691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15692', '1', '1', '1', '143316', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '75', '2024-11-05 17:33:55','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143316', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:33:55', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143316', '17', '10291', '1', '13', '13', '0', '', '1', '2024-11-05 17:33:55', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','13','13','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 2665;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1298, 1025, 1025
                    , 1025, 1025, 1025, 1025
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1025, 1025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1298, sellCostBuyPrice =sellCostBuyPrice+1025
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1025, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1025
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1025, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1025
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1025
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1025
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1025
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2665, '2024-11-05', 1298, 1025, 1025
                    , 1025, 1025, 1025, 1025
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1025, 1025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1298, sellCostBuyPrice =sellCostBuyPrice+1025
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1025, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1025
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1025, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1025
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1025
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1025
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1025
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1298, 1025, 1025
                    , 1025, 1025, 1025, 1025, 1025, 1025)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1298, netSellCostBuyPrice = netSellCostBuyPrice+1025
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1025
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1025
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1025
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1025
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1025
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1025
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1025;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3a55b4415 and sellbillId = 143316 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:03:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:33:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:33:55', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6949','','5','495','550', '550','550', '2024-11-05', '0', '77', '1', '06949', '0', '0', '0', '0', '0', '495','495','495','495','495','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','495','495','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15876, 1,'2024-11-05 17:33:57',77)
                ON DUPLICATE KEY UPDATE productid = 15876, edited = 1, sysdate = '2024-11-05 17:33:57', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15876', '1', '2024-11-05', '77', '0','1587601','550','550','550','495','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15876', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15876', '1', '0', '0', '15876', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('K795','','7','495','550', '550','550', '2024-11-05', '0', '77', '1', '0K795', '0', '0', '0', '0', '0', '495','495','495','495','495','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','495','495','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15877, 1,'2024-11-05 17:34:26',77)
                ON DUPLICATE KEY UPDATE productid = 15877, edited = 1, sysdate = '2024-11-05 17:34:26', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15877', '1', '2024-11-05', '77', '0','1587701','550','550','550','495','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15877', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15877', '1', '0', '0', '15877', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:04:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:34:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:34:33', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:05:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:35:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:35:09', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:05:37";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:35:37", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:35:37', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a3a7d0d46b', '2024-11-05 17:32:13', '80', '186420.00', '242520', '0', '0', '56100',  '56100', '0', '56100', '1', '2024-11-05 17:35:37', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06950', '13625', '5', '15873', '15', '520', '7800', '0', '', '2024-11-05 17:35:37', '15873','','','0','0','0','0','0',null,'520','7800','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15873, 0, 0
                    , 520, 15, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 520,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15873', '520', '15', '0', 'buyBillController.php', '31387', '', '0', '0');
UPDATE product SET  productBuyPrice = "520" WHERE productId = 15873 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31387 ;
UPDATE product SET productName = '6950', productDescription = '', productCatId = '5', productBuyPrice = '520.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06950',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520',lastbuyprice_withDiscount = '520',meanbuyprice = '520',meanbuyprice_withDiscount = '520' , productbuypricereal = '520.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='520',meanbuyprice_withTax='520',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='520'  WHERE productId = '15873';
UPDATE buybilldetail SET  lastbuyprice = 520 , meanbuyprice = 520, lastbuyprice_withDiscount = 520, meanbuyprice_withDiscount = 520
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 520, lastbuyprice_withDiscountAndTax = 520
                where buybilldetailid = 31387;
UPDATE productunit SET proUnitBuyPrice  = 520 * productnumber WHERE productid = 15873;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15872';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15873', '1', '15', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 17:32:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06948', '13625', '5', '15874', '15', '480', '7200', '0', '', '2024-11-05 17:35:37', '15874','','','0','0','0','0','0',null,'480','7200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15874, 0, 0
                    , 480, 15, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 480,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15874', '480', '15', '0', 'buyBillController.php', '31388', '', '0', '0');
UPDATE product SET  productBuyPrice = "480" WHERE productId = 15874 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31388 ;
UPDATE product SET productName = '6948', productDescription = '', productCatId = '5', productBuyPrice = '480.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06948',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='480',meanbuyprice_withTax='480',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='480'  WHERE productId = '15874';
UPDATE buybilldetail SET  lastbuyprice = 480 , meanbuyprice = 480, lastbuyprice_withDiscount = 480, meanbuyprice_withDiscount = 480
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 480
                where buybilldetailid = 31388;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 15874;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15873';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15874', '1', '15', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 17:32:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06947', '13625', '5', '15875', '10', '495', '4950', '0', '', '2024-11-05 17:35:37', '15875','','','0','0','0','0','0',null,'495','4950','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15875, 0, 0
                    , 495, 10, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 495,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15875', '495', '10', '0', 'buyBillController.php', '31389', '', '0', '0');
UPDATE product SET  productBuyPrice = "495" WHERE productId = 15875 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31389 ;
UPDATE product SET productName = '6947', productDescription = '', productCatId = '5', productBuyPrice = '495.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06947',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '495',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '495.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='495',meanbuyprice_withTax='495',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='495'  WHERE productId = '15875';
UPDATE buybilldetail SET  lastbuyprice = 495 , meanbuyprice = 495, lastbuyprice_withDiscount = 495, meanbuyprice_withDiscount = 495
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where buybilldetailid = 31389;
UPDATE productunit SET proUnitBuyPrice  = 495 * productnumber WHERE productid = 15875;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15874';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15875', '1', '10', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '10', '77', '2024-11-05 17:32:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06949', '13625', '5', '15876', '15', '495', '7425', '0', '', '2024-11-05 17:35:37', '15876','','','0','0','0','0','0',null,'495','7425','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15876, 0, 0
                    , 495, 15, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 495,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15876', '495', '15', '0', 'buyBillController.php', '31390', '', '0', '0');
UPDATE product SET  productBuyPrice = "495" WHERE productId = 15876 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31390 ;
UPDATE product SET productName = '6949', productDescription = '', productCatId = '5', productBuyPrice = '495.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06949',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '495',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '495.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='495',meanbuyprice_withTax='495',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='495'  WHERE productId = '15876';
UPDATE buybilldetail SET  lastbuyprice = 495 , meanbuyprice = 495, lastbuyprice_withDiscount = 495, meanbuyprice_withDiscount = 495
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where buybilldetailid = 31390;
UPDATE productunit SET proUnitBuyPrice  = 495 * productnumber WHERE productid = 15876;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15875';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15876', '1', '15', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 17:32:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06928', '13625', '5', '15802', '10', '465', '4650', '0', '', '2024-11-05 17:35:37', '15802','','','0','0','0','0','0',null,'465','4650','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15802, 0, 0
                    , 465, 10, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 465,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15802', '465', '10', '0', 'buyBillController.php', '31391', '', '0', '0');
UPDATE product SET  productBuyPrice = "465" WHERE productId = 15802 ;
UPDATE buybilldetail SET  quantitybefore = 13 WHERE buybilldetailid = 31391 ;
UPDATE product SET productName = '6928', productDescription = '', productCatId = '5', productBuyPrice = '465.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06928',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '465',lastbuyprice_withDiscount = '465',meanbuyprice = '465',meanbuyprice_withDiscount = '465' , productbuypricereal = '465.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='465',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='465',meanbuyprice_withTax='465',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='465'  WHERE productId = '15802';
UPDATE buybilldetail SET  lastbuyprice = 465 , meanbuyprice = 465, lastbuyprice_withDiscount = 465, meanbuyprice_withDiscount = 465
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 465, lastbuyprice_withDiscountAndTax = 465
                where buybilldetailid = 31391;
UPDATE productunit SET proUnitBuyPrice  = 465 * productnumber WHERE productid = 15802;
UPDATE storedetail SET  productquantity = '23', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15801';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15802', '1', '10', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '13', '23', '77', '2024-11-05 17:32:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('0K795', '13625', '7', '15877', '15', '490', '7350', '0', '', '2024-11-05 17:35:37', '15877','','','0','0','0','0','0',null,'490','7350','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15877, 0, 0
                    , 490, 15, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 490,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15877', '490', '15', '0', 'buyBillController.php', '31392', '', '0', '0');
UPDATE product SET  productBuyPrice = "490" WHERE productId = 15877 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31392 ;
UPDATE product SET productName = 'K795', productDescription = '', productCatId = '7', productBuyPrice = '490.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '0K795',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , productbuypricereal = '495.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='490',meanbuyprice_withTax='490',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='490'  WHERE productId = '15877';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 490, meanbuyprice_withDiscount = 490
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where buybilldetailid = 31392;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 15877;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15876';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15877', '1', '15', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 17:32:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06944', '13625', '5', '15819', '10', '420', '4200', '0', '', '2024-11-05 17:35:37', '15819','','','0','0','0','0','0',null,'420','4200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15819, 0, 0
                    , 420, 10, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15819', '420', '10', '0', 'buyBillController.php', '31393', '', '0', '0');
UPDATE product SET  productBuyPrice = "420" WHERE productId = 15819 ;
UPDATE buybilldetail SET  quantitybefore = 50 WHERE buybilldetailid = 31393 ;
UPDATE product SET productName = '6944', productDescription = '', productCatId = '5', productBuyPrice = '420.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06944',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '420',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420'  WHERE productId = '15819';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 31393;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 15819;
UPDATE storedetail SET  productquantity = '60', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '10', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '50', '60', '77', '2024-11-05 17:32:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06901', '13625', '5', '15736', '10', '360', '3600', '0', '', '2024-11-05 17:35:37', '15736','','','0','0','0','0','0',null,'360','3600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15736, 0, 0
                    , 360, 10, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15736', '360', '10', '0', 'buyBillController.php', '31394', '', '0', '0');
UPDATE product SET  productBuyPrice = "360" WHERE productId = 15736 ;
UPDATE buybilldetail SET  quantitybefore = 30 WHERE buybilldetailid = 31394 ;
UPDATE product SET productName = '6901', productDescription = '', productCatId = '5', productBuyPrice = '360.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = '06901',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='360',meanbuyprice_withTax='360',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360'  WHERE productId = '15736';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 31394;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 15736;
UPDATE storedetail SET  productquantity = '40', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15736', '1', '10', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '30', '40', '77', '2024-11-05 17:32:13','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1400', '13625', '14', '15652', '15', '595', '8925', '0', '', '2024-11-05 17:35:37', '15652','','','0','0','0','0','0',null,'595','8925','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:32:13', 1, 15652, 0, 0
                    , 595, 15, 0, 0, 77, '2024-11-05 17:35:37')
                ON DUPLICATE KEY UPDATE buyprice = 595,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:35:37' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15652', '595', '15', '0', 'buyBillController.php', '31395', '', '0', '0');
UPDATE product SET  productBuyPrice = "595" WHERE productId = 15652 ;
UPDATE buybilldetail SET  quantitybefore = -3 WHERE buybilldetailid = 31395 ;
UPDATE product SET productName = 'H1400', productDescription = '', productCatId = '14', productBuyPrice = '595.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1400',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '595',lastbuyprice_withDiscount = '595',meanbuyprice = '595',meanbuyprice_withDiscount = '595' , productbuypricereal = '595.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='595',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='595',meanbuyprice_withTax='595',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='595'  WHERE productId = '15652';
UPDATE buybilldetail SET  lastbuyprice = 595 , meanbuyprice = 595, lastbuyprice_withDiscount = 595, meanbuyprice_withDiscount = 595
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where buybilldetailid = 31395;
UPDATE productunit SET proUnitBuyPrice  = 595 * productnumber WHERE productid = 15652;
UPDATE storedetail SET  productquantity = '12', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '15', '0', '13625', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-3', '12', '77', '2024-11-05 17:32:13','0','0');
UPDATE supplier SET  suppliercurrentDebt = '242520',suppliercurrentDebtInCurrency= '242520' , userid = '77', supplierdate = '2024-11-05 17:35:37'   WHERE supplierid = '80';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('80', '186420.00', '56100', '0', 'اضافة فاتورة مشتريات', '13625', '242520', '2024-11-05 17:32:13', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','56100','1','186420','56100','242520','0');
update buybill set dailyentryid='0,' where buybillid=13625;
COMMIT;
UPDATE product SET overAllAveragePrice = 595 WHERE productId = 15652;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 15736;UPDATE product SET overAllAveragePrice = 465 WHERE productId = 15802;UPDATE product SET overAllAveragePrice = 420 WHERE productId = 15819;UPDATE product SET overAllAveragePrice = 520 WHERE productId = 15873;UPDATE product SET overAllAveragePrice = 480 WHERE productId = 15874;UPDATE product SET overAllAveragePrice = 495 WHERE productId = 15875;UPDATE product SET overAllAveragePrice = 495 WHERE productId = 15876;UPDATE product SET overAllAveragePrice = 490 WHERE productId = 15877;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:05:38";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:35:38", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:35:38', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13625');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:05:47";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:35:47", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:35:47', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13625&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:05:48";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:35:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:35:48', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:05:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:35:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:35:54', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:07:37";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:37:37", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:37:37', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3ae3e718a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(316,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:33:55', '0672a3ae3e718a', '316', '0.00', '2106', '0', '1', '2106.00', '2106', '0', '2106', '1', '2024-11-05 17:37:37', '', '75', '0', 'مروي زين', '2', '1', '3', '85', 'مروي زين', '7' ,'0','','','','','-1','0','0','0','0','0','2106','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2106', userid = '75' WHERE clientid = '316';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('316','0.00','2106','0','اضافة فاتورة مبيعات','143317', '2106', '2024-11-05 17:37:37', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2106', '0', null, '0', null, null,'', '0','1','1','2106','1','2024-11-05 17:33:55','0','0');
UPDATE client SET  inUse = 0 where clientid = 316;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34377;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1369', '143317', '14', '15545', '1', '650', '650', '0', '', '1', '2024-11-05 17:37:37', '15545', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34377-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        
                where sellbilldetailid = 523912;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15545, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 17:37:37' WHERE storedetailid = '15544';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15545', '1', '1', '1', '143317', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 17:37:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34093;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1300', '143317', '14', '15378', '2', '380', '760', '0', '', '1', '2024-11-05 17:37:38', '15378', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34093-2,','1','1','0','0','380','760','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 523913;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15378, '2024-11-05', 760, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+760, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 760, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+760, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 17:37:38' WHERE storedetailid = '15377';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15378', '1', '2', '1', '143317', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '9', '75', '2024-11-05 17:37:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34383;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','88248', '143317', '5', '15550', '1', '300', '300', '0', '', '1', '2024-11-05 17:37:38', '15550', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34383-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 523914;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15550, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 17:37:38' WHERE storedetailid = '15549';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15550', '1', '1', '1', '143317', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 17:37:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32781;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('335','06423', '143317', '5', '14631', '1', '355', '355', '0', '', '1', '2024-11-05 17:37:38', '14631', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32781-1,','1','1','0','0','355','355','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 335.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 335.00
        
                where sellbilldetailid = 523915;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14631, '2024-11-05', 355, 335, 335
                    , 335, 335, 335, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+355, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 355, 335, 335
                    , 335, 335, 335, 335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+355, sellCostBuyPrice =sellCostBuyPrice+335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+335, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 17:37:38' WHERE storedetailid = '14630';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14631', '1', '1', '1', '143317', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 17:37:38','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143317', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:37:38', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143317', '17', '10291', '1', '21', '21', '0', '', '1', '2024-11-05 17:37:38', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','21','21','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 85 where clientid = 316;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2106, 1750, 1750
                    , 1750, 1750, 1750, 1750
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2106, sellCostBuyPrice =sellCostBuyPrice+1750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (316, '2024-11-05', 2106, 1750, 1750
                    , 1750, 1750, 1750, 1750
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2106, sellCostBuyPrice =sellCostBuyPrice+1750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2106, 1750, 1750
                    , 1750, 1750, 1750, 1750, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2106, netSellCostBuyPrice = netSellCostBuyPrice+1750
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1750
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1750
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1750
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1750
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1750
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3ae3e718a and sellbillId = 143317 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:07:38";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:37:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:37:38', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:07:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:37:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:37:50', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3b0a2b1f7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:34:34', '0672a3b0a2b1f7', '1', '0.00', '0', '0', '1', '350.00', '350', '350', '0', '1', '2024-11-05 17:37:50', '', '9', '0', 'نقدي', '1', '0', '3', '8', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','350','0','','0','0','350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143318', '0', '2024-11-05 17:37:50', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '350', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:34:34','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34449;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3251', '143318', '1', '15589', '1', '350', '350', '0', '', '1', '2024-11-05 17:37:50', '15589', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34449-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523918;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15589, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-05 17:37:50' WHERE storedetailid = '15588';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15589', '1', '1', '1', '143318', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-05 17:37:50','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '47204',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46854','350', '0', '1', 'اضافة فاتورة مبيعات', '143318', '47204', '2024-11-05 17:37:50', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 8 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,285, 285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 350, 285, 285
                    , 285, 285, 285, 285, 285, 285)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+350, netSellCostBuyPrice = netSellCostBuyPrice+285
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+285
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+285
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+285
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+285
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+285
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+285
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+285;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3b0a2b1f7 and sellbillId = 143318 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:07:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:37:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:37:51', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:08:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:38:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:38:22', '2', 'remove', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=remove&id=235817&action=118920');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController delete - with clientdebtchangeId =235817
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7264,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '2868', userid = '2' WHERE clientid = '7264';
UPDATE client SET  inUse = 0 where clientid = 7264;
UPDATE clientdebtchange SET del='1' WHERE clientdebtchangeid = '235817';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid, del,dailyentryid , num , billid ,paytype,seller,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments) VALUES ('7264','384.00','2484.000','0','الغاء سداد ديون عميل','235817', '2868', '2024-11-05 17:38:22', '2', 'clientPayedDeptController.php', '', '2484', '0', null, '1', '118920', null, null,'','0','1','1','2484','1','','0','0');
UPDATE save SET  savecurrentvalue = '209192.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('211676.50','2484', '1', '2', 'الغاء سداد ديون عميل', '235949', '209192.5', '2024-11-05 17:38:23', '2',  'clientPayedDeptController.php','0','','0');
UPDATE dailyentry SET totalcreditor = '2484.00', totaldebtor = '2484.00', thedate = '2024-11-05', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2024-11-05 14:33:30', entryComment = 'اضافة ايصال سداد للعميل اية نبيل اسماعلية y12', fromFlag = '1',related='0',isopeningentry='0',operationId='235817',operationDetailLink='clientPayedDeptController.php?do=show&id=235817' WHERE id = '118920';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2484.00', '2484.00', '2024-11-05', '2', '0', '118920', '2024-11-05 17:38:23','تم عكس القيد رقم 118920 ','1','0','0','0','0','');
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118965', '-1', '2484.00', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-2484', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118965', '11191', '2484.00', '','0');
UPDATE accountstree SET name = 'اية نبيل اسماعلية y12', customName = 'اية نبيل اسماعلية y12', customNameEn = 'اية نبيل اسماعلية y12', nameEn = 'اية نبيل اسماعلية y12', parent = '58', accountNature = '0', theValue = '384', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 14:33:30' WHERE id = '11191';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController delete end - with clientdebtchangeId =235817
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:08:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:38:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:38:23', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:08:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:38:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:38:25', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:13";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:39:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:39:13', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:18";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:39:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:39:18', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:29";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:39:29", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:39:29', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3ad9c38cb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(637,@clientdebt,@clientname,@treeIdis);
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 17:33:45', '0672a3ad9c38cb', '637', '9420.00', '9165', '30', '1', '285', '255', '0', '-255', '1', '2024-11-05 17:39:30', '', '9', '0', 'فؤاد ادوار V0001','1', '1', '5', '24', 'فؤاد ادوار V0001', '1', '0', '', '','','','-1','0','0','0','','0','0','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '9165', userid = '9' WHERE clientid = '637';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('637','9420.00','255','1','اضافة فاتورة مردوات مبيعات','16234', '9165', '2024-11-05 17:39:30', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '255', '0', null, '0', null, null,'', '0','1','1','255','1','2024-11-05 17:33:45','0','0');
UPDATE client SET  inUse = 0 where clientid = 637;
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('235.00', '06818', '16234', '5', '15518', '1', '285', '285', '0', '', '1', '0', '15518', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','285','285','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where returnsellbilldetailid = 21274;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15518, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 315, 235, 235, 235
                    , 235, 235, 235, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+315, returnSellCostBuyPrice = returnSellCostBuyPrice+235, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+235
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+235, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+235
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+235
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+235
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 315, 235, 235, 235
                    , 235, 235, 235, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+315, returnSellCostBuyPrice = returnSellCostBuyPrice+235, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+235
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+235, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+235
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+235
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+235
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 17:39:30' WHERE storedetailid = '15517';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15518', '1', '1', '0', '16234', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '7', '8', '9', '2024-11-05 17:39:30','0','0');
UPDATE client SET  delegateid = 24 where clientid = 637;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 255, 235, 235, 235
                    , 235, 235, 235 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+255, returnSellCostBuyPrice = returnSellCostBuyPrice+235, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+235
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+235, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+235
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+235
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+235
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (637, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 255, 235, 235, 235
                    , 235, 235, 235 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+255, returnSellCostBuyPrice = returnSellCostBuyPrice+235, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+235
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+235, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+235
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+235
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+235
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -255, -235, -235
                    , -235, -235, -235, -235, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-255, netSellCostBuyPrice = netSellCostBuyPrice+-235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-235
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-235
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-235
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-235
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-235
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3ad9c38cb and sellbillId = 16234 and returnsellbillId = 16234
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:39:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:39:30', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:31";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:39:31", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:39:31', '77', 'all', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=all');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:39:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:39:42', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235950
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7264,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '20' , clientdate = '2024-11-05 17:39:42', userid = '2' WHERE clientid = '7264';
UPDATE client SET  inUse = 0 where clientid = 7264;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7264','2868.00','2848','1','ايصال تحصيل (( قبض من عميل ))','235950', '20', '2024-11-05 17:39:13', '2', 'clientPayedDeptController.php', '   ', '2848', '0', null, '0', null, null,'', '-1','1','1','2848','1','','815','0');
UPDATE save SET  savecurrentvalue = '212040.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('209192.50','2848', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '235951', '212040.5', '2024-11-05 17:39:42', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2848', '2848', '2024-11-05', '2', '0', '0', '2024-11-05 17:39:42','اضافة ايصال سداد للعميل اية نبيل اسماعلية y12','1','0','0','0','235951','clientPayedDeptController.php?do=show&id=235951');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118966', '-1', '2848', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2848', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118966', '-1', '2848', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-2848', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '7264', clientdebtchangebefore = '2868.000', clientdebtchangeamount = '2848.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235950', clientdebtchangeafter = '20.000', clientdebtchangedate = '2024-11-05 17:39:13', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2848.00',discount='', reciptid='0', dailyentryid = '118966',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2848',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235951';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235950 -clientdebtchangeId = 235951
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:39:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:39:42', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:39:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:39:57', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3c32ca86b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 17:39:30', '0672a3c32ca86b', '1', '0.00', '0', '0', '1', '550', '550', '-550', '0', '1', '2024-11-05 17:39:57', '', '9', '0', 'نقدي','1', '0', '5', '24', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-550','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16235', '0', '2024-11-05 17:39:57', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '550', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:39:30','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('450.00', 'H1371', '16235', '14', '15566', '1', '550', '550', '0', '', '1', '0', '15566', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','550','550','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        
                where returnsellbilldetailid = 21275;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15566, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 450, 450, 450
                    , 450, 450, 0, 0, 1, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+450, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+450
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+450, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+450
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+450
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 450, 450, 450
                    , 450, 450, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+450, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+450
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+450, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+450
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+450
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '9', storedetaildate = '2024-11-05 17:39:57' WHERE storedetailid = '15565';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15566', '1', '1', '0', '16235', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '3', '4', '9', '2024-11-05 17:39:57','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '46654',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('47204','-550', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16235', '46654', '2024-11-05 17:39:57', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 450, 450, 450
                    , 450, 450, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+450, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+450
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+450, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+450
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+450
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 550, 450, 450, 450
                    , 450, 450, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+550, returnSellCostBuyPrice = returnSellCostBuyPrice+450, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+450
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+450, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+450
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+450
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -550, -450, -450
                    , -450, -450, -450, 0, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-550, netSellCostBuyPrice = netSellCostBuyPrice+-450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-450
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-450
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3c32ca86b and sellbillId = 16235 and returnsellbillId = 16235
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:09:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:39:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:39:57', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:40:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:40:01', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:07";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:40:07", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:40:07', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:40:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 17:40:09', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:40:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:40:17', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235953
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(637,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '8615' , clientdate = '2024-11-05 17:40:17', userid = '9' WHERE clientid = '637';
UPDATE client SET  inUse = 0 where clientid = 637;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('637','9165.00','550','1','ايصال تحصيل (( قبض من عميل ))','235953', '8615', '2024-11-05 17:40:01', '9', 'clientPayedDeptController.php', '   ', '550', '0', null, '0', null, null,'', '-1','1','1','550','1','','816','0');
UPDATE save SET  savecurrentvalue = '47204',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46654.00','550', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235953', '47204', '2024-11-05 17:40:17', '9',  'clientPayedDeptController.php','0','','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:40:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:40:17', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142572');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '550', '550', '2024-11-05', '9', '0', '0', '2024-11-05 17:40:18','اضافة ايصال سداد للعميل فؤاد ادوار V0001','1','0','0','0','235953','clientPayedDeptController.php?do=show&id=235953');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118967', '-1', '550', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '550', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118967', '-1', '550', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-550', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '637', clientdebtchangebefore = '9165.000', clientdebtchangeamount = '550.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235953', clientdebtchangeafter = '8615.000', clientdebtchangedate = '2024-11-05 17:40:01', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '550.00',discount='', reciptid='0', dailyentryid = '118967',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='550',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235953';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235953 -clientdebtchangeId = 235953
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:18";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:40:18", deviceType = "DESKTOP" WHERE userid = 9;
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:40:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 17:40:18', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:40:18', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:40:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:40:20', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:10:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:40:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:40:22', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('وفاء محمد 41' , '', '', '01116576364', '0', '', '0', '2024-11-05 17:40:25', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10287', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10287','0','0','0','إضافة عميل جديد','10287', '0', '2024-11-05 17:40:25', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('وفاء محمد 41', 'وفاء محمد 41', 'وفاء محمد 41', 'وفاء محمد 41', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 17:40:25');
UPDATE client SET clientname = 'وفاء محمد 41', clientaddress = '', clientphone = '', clientmobile = '01116576364', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11222',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10287';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:11:10";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:41:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:41:10', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:42:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:42:03', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235954
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(637,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1815' , clientdate = '2024-11-05 17:42:03', userid = '9' WHERE clientid = '637';
UPDATE client SET  inUse = 0 where clientid = 637;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('637','8615.00','6800','1','ايصال تحصيل (( قبض من عميل ))','235954', '1815', '2024-11-05 17:40:22', '9', 'clientPayedDeptController.php', '   ', '6800', '0', null, '0', null, null,'', '-1','1','1','6800','1','','817','0');
UPDATE save SET  savecurrentvalue = '54004',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('47204.00','6800', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235955', '54004', '2024-11-05 17:42:03', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6800', '6800', '2024-11-05', '9', '0', '0', '2024-11-05 17:42:03','اضافة ايصال سداد للعميل فؤاد ادوار V0001','1','0','0','0','235955','clientPayedDeptController.php?do=show&id=235955');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118968', '-1', '6800', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '6800', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118968', '-1', '6800', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-6800', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '637', clientdebtchangebefore = '8615.000', clientdebtchangeamount = '6800.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235954', clientdebtchangeafter = '1815.000', clientdebtchangedate = '2024-11-05 17:40:22', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '6800.00',discount='', reciptid='0', dailyentryid = '118968',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='6800',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235955';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235954 -clientdebtchangeId = 235955
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:42:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:42:04', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:42:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:42:04', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143142');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:42:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 17:42:06', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:42:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:42:18', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143142 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143142 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143142;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 17:42:18', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143142';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34008;
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 523252;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15333, '2024-11-05', 400, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-340, sellCostMeanBuyPrice = sellCostMeanBuyPrice-340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-340, sellCostMeanBuyPrice = sellCostMeanBuyPrice-340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '15332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15333', '1', '1', '0', '143142', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '7', '2', '2024-11-04 17:11:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 28486;
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 253.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 253.00
        
                where sellbilldetailid = 523253;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12102, '2024-11-05', 190, 265, 265
                    , 253, 265, 253, 246.25
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-265, sellCostMeanBuyPrice = sellCostMeanBuyPrice-253
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-253
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-246.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 265, 265
                    , 253, 265, 253, 246.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-265, sellCostMeanBuyPrice = sellCostMeanBuyPrice-253
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-253
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-246.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '14', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '12101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12102', '1', '1', '0', '143142', 'تعديل فاتورة مبيعات', 'sellbillController.php', '13', '14', '2', '2024-11-04 17:11:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31699;
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        
                where sellbilldetailid = 523254;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14157, '2024-11-05', 235, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-235, sellCostBuyPrice =sellCostBuyPrice-230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-230, sellCostMeanBuyPrice = sellCostMeanBuyPrice-230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-235, sellCostBuyPrice =sellCostBuyPrice-230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-230, sellCostMeanBuyPrice = sellCostMeanBuyPrice-230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '14156';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14157', '1', '1', '0', '143142', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '7', '2', '2024-11-04 17:11:37','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 523255;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13920, '2024-11-05', 250, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-250, sellCostBuyPrice =sellCostBuyPrice-240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-240, sellCostMeanBuyPrice = sellCostMeanBuyPrice-240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 250, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-250, sellCostBuyPrice =sellCostBuyPrice-240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-240, sellCostMeanBuyPrice = sellCostMeanBuyPrice-240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '13919';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13920', '1', '1', '0', '143142', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '2', '2024-11-04 17:11:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33917;
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 4, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523256;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15271, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-140, sellCostMeanBuyPrice = sellCostMeanBuyPrice-140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-140, sellCostMeanBuyPrice = sellCostMeanBuyPrice-140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '15270';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15271', '1', '1', '0', '143142', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '2', '2024-11-04 17:11:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 27966;
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 182.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 182.00
        
                where sellbilldetailid = 523257;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12222, '2024-11-05', 150, 185, 180
                    , 182, 180, 182, 181.88
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-150, sellCostBuyPrice =sellCostBuyPrice-185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-180, sellCostMeanBuyPrice = sellCostMeanBuyPrice-182
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-181.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 185, 180
                    , 182, 180, 182, 181.88
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-150, sellCostBuyPrice =sellCostBuyPrice-185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-180, sellCostMeanBuyPrice = sellCostMeanBuyPrice-182
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-181.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '12221';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12222', '1', '1', '0', '143142', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-04 17:11:37','0','0');
CALL clientInUse(9495,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-1049', userid = '2' WHERE clientid = '9495';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9495','400.00','1449.00','1','تعديل فاتورة مبيعات','143142', '-1049', '2024-11-04 17:11:37', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '1449', '0', null, '0', null, null,'', '0','1','1','1449','1','2024-11-04 17:11:37','0','0');
UPDATE client SET  inUse = 0 where clientid = 9495;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1449, 1400, 1395
                    , 1385, 1395, 1385, 1378.13
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1449, sellCostBuyPrice =sellCostBuyPrice-1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1395, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1378.13
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9495, '2024-11-05', 1449, 1400, 1395
                    , 1385, 1395, 1385, 1378.13
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1449, sellCostBuyPrice =sellCostBuyPrice-1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1395, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1385
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1385
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1378.13
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1449, 1400, 1395
                    , 1385, 1395, 1385, 1378.13, 140, 4)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-1449, netSellCostBuyPrice = netSellCostBuyPrice-1400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1395
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1385
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1395
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1385
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1378.13
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-4;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143142 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143142 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(9495,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-04 17:11:37', '06728e42900613', '9495', '-1049.00', '0', '0', '1', '1049', '1049', '0', '1049', '1', '2024-11-04 17:11:37', '', '2', '0', 'مريم غالي I334', '2', '1', '3', '87', 'مريم غالي I334', '7', '143142', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-04','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '9495';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9495','-1049.00','1049','0','اضافة فاتورة مبيعات (معدله)','143319', '0', '2024-11-05 17:42:18', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '1049', '0', null, '0', null, null,'', '0','1','1','1449','1','2024-11-04 17:11:37','0','0');
UPDATE client SET  inUse = 0 where clientid = 9495;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28486;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265','R2486', '143319', '1', '12102', '1', '190', '190', '0', '', '1', '2024-11-05 17:42:18', '12102', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28486-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 253.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 253.00
        
                where sellbilldetailid = 523919;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12102, '2024-11-05', 190, 265, 265
                    , 253, 265, 253, 246.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+253
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+253
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+246.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 265, 265
                    , 253, 265, 253, 246.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+253
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+253
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+246.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '12101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12102', '1', '1', '1', '143319', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '14', '13', '2', '2024-11-05 17:42:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31699;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','R2835', '143319', '1', '14157', '1', '235', '235', '0', '', '1', '2024-11-05 17:42:18', '14157', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31699-1,','1','1','0','0','235','235','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        
                where sellbilldetailid = 523920;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14157, '2024-11-05', 235, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '14156';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14157', '1', '1', '1', '143319', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '7', '6', '2', '2024-11-05 17:42:18','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R2799', '143319', '1', '13920', '1', '250', '250', '0', '', '1', '2024-11-05 17:42:18', '13920', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 523921;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13920, '2024-11-05', 250, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 250, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '13919';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13920', '1', '1', '1', '143319', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '2', '2024-11-05 17:42:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33917;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06724', '143319', '5', '15271', '1', '190', '190', '0', '', '1', '2024-11-05 17:42:18', '15271', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33917-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 4, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 523922;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15271, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '15270';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15271', '1', '1', '1', '143319', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '4', '2', '2024-11-05 17:42:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27966;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('180','R2508', '143319', '1', '12222', '1', '150', '150', '0', '', '1', '2024-11-05 17:42:18', '12222', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27966-1,','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 182.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 182.00
        
                where sellbilldetailid = 523923;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12222, '2024-11-05', 150, 185, 180
                    , 182, 180, 182, 181.88
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+182
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+181.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 185, 180
                    , 182, 180, 182, 181.88
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+182
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+181.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 17:42:18' WHERE storedetailid = '12221';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12222', '1', '1', '1', '143319', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '2', '2024-11-05 17:42:18','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143319', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:42:18', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143319', '17', '10291', '1', '14', '14', '0', '', '1', '2024-11-05 17:42:18', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14','14','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1049, 1060, 1055
                    , 1045, 1055, 1045, 1038.13
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1049, sellCostBuyPrice =sellCostBuyPrice+1060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1055, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1045
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1055, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1045
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1038.13
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9495, '2024-11-05', 1049, 1060, 1055
                    , 1045, 1055, 1045, 1038.13
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1049, sellCostBuyPrice =sellCostBuyPrice+1060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1055, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1045
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1055, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1045
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1038.13
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1049, 1060, 1055
                    , 1045, 1055, 1045, 1038.13, 140, 4)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1049, netSellCostBuyPrice = netSellCostBuyPrice+1060
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1055
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1045
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1055
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1045
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1038.13
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143142 and newid=143319 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:19";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:42:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:42:19', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143319');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:42:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:42:27', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:44";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:42:44", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:42:44', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a39a020369
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10287,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:28:32', '0672a39a020369', '10287', '0.00', '2015', '0', '1', '2015.00', '2015', '0', '2015', '1', '2024-11-05 17:42:44', '', '75', '0', 'وفاء محمد 41', '2', '1', '3', '87', 'وفاء محمد 41', '8' ,'0','','','','','-1','0','0','0','0','0','2015','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2015', userid = '75' WHERE clientid = '10287';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10287','0.00','2015','0','اضافة فاتورة مبيعات','143320', '2015', '2024-11-05 17:42:44', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2015', '0', null, '0', null, null,'', '0','1','1','2015','1','2024-11-05 17:28:32','0','0');
UPDATE client SET  inUse = 0 where clientid = 10287;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27914;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('425','05408', '143320', '5', '11785', '1', '480', '480', '0', '', '1', '2024-11-05 17:42:44', '11785', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27914-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 470.00
        
                where sellbilldetailid = 523926;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11785, '2024-11-05', 480, 425, 425
                    , 470, 425, 470, 425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 425, 425
                    , 470, 425, 470, 425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 17:42:44' WHERE storedetailid = '11784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11785', '1', '1', '1', '143320', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-05 17:42:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34715;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06891', '143320', '5', '15664', '1', '210', '210', '0', '', '1', '2024-11-05 17:42:44', '15664', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34715-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        , lastbuyprice_withTax = 145, meanbuyprice_withTax = 145, lastbuyprice_withDiscountAndTax = 145
                where sellbilldetailid = 523927;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15664, '2024-11-05', 210, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 145, 145, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+145
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 145, 145, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+145
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+145
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '41', userid = '75', storedetaildate = '2024-11-05 17:42:44' WHERE storedetailid = '15663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15664', '1', '1', '1', '143320', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '41', '75', '2024-11-05 17:42:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34709;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('110','R3241', '143320', '1', '15581', '1', '165', '165', '0', '', '1', '2024-11-05 17:42:44', '15581', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34709-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 112.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 112.00
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 77, lastbuyprice_withDiscountAndTax = 110
                where sellbilldetailid = 523928;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15581, '2024-11-05', 165, 110, 110
                    , 112, 110, 112, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 110, 77, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+112
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+112
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+77
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 110, 110
                    , 112, 110, 112, 113.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 77, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+112
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+112
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+113.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+77
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '75', storedetaildate = '2024-11-05 17:42:44' WHERE storedetailid = '15580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15581', '1', '1', '1', '143320', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '23', '75', '2024-11-05 17:42:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34611;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1357', '143320', '14', '15477', '1', '360', '360', '0', '', '1', '2024-11-05 17:42:44', '15477', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34611-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 277, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 523929;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15477, '2024-11-05', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 360, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 277, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '75', storedetaildate = '2024-11-05 17:42:44' WHERE storedetailid = '15476';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15477', '1', '1', '1', '143320', 'اضافة فاتورة مبيعات', 'sellbillController.php', '58', '57', '75', '2024-11-05 17:42:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34803;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('465','06928', '143320', '5', '15802', '1', '520', '520', '0', '', '1', '2024-11-05 17:42:44', '15802', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34803-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 465.00, meanbuyprice_withDiscount = 465.00
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 465, lastbuyprice_withDiscountAndTax = 465
                where sellbilldetailid = 523930;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15802, '2024-11-05', 520, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '75', storedetaildate = '2024-11-05 17:42:44' WHERE storedetailid = '15801';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15802', '1', '1', '1', '143320', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '75', '2024-11-05 17:42:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34555;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06895', '143320', '5', '15667', '1', '240', '240', '0', '', '1', '2024-11-05 17:42:44', '15667', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34555-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 523931;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15667, '2024-11-05', 240, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '75', storedetaildate = '2024-11-05 17:42:44' WHERE storedetailid = '15666';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15667', '1', '1', '1', '143320', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '75', '2024-11-05 17:42:44','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143320', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:42:44', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143320', '17', '10291', '1', '20', '20', '0', '', '1', '2024-11-05 17:42:44', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 10287;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2015, 1620, 1620
                    , 1667, 1620, 1667, 1623.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1195, 1139, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2015, sellCostBuyPrice =sellCostBuyPrice+1620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1667
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1667
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1623.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1139
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10287, '2024-11-05', 2015, 1620, 1620
                    , 1667, 1620, 1667, 1623.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1195, 1139, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2015, sellCostBuyPrice =sellCostBuyPrice+1620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1667
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1667
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1623.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1195
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1139
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2015, 1620, 1620
                    , 1667, 1620, 1667, 1623.33, 1195, 1139)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2015, netSellCostBuyPrice = netSellCostBuyPrice+1620
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1620
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1667
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1620
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1667
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1623.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1195
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1139;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a39a020369 and sellbillId = 143320 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:12:45";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:42:45", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:42:45', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:13:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:43:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:43:00', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3ce403814
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:42:28', '0672a3ce403814', '1', '0.00', '0', '0', '1', '380.00', '380', '380', '0', '1', '2024-11-05 17:43:00', '', '9', '0', 'نقدي', '1', '0', '3', '99', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','380','0','','0','0','380','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143321', '0', '2024-11-05 17:43:00', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '380', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:42:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34221;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06712', '143321', '5', '15227', '1', '380', '380', '0', '', '1', '2024-11-05 17:43:00', '15227', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34221-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 960, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 523934;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15227, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '9', storedetaildate = '2024-11-05 17:43:00' WHERE storedetailid = '15226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15227', '1', '1', '1', '143321', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '9', '2024-11-05 17:43:00','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '54384',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('54004','380', '0', '1', 'اضافة فاتورة مبيعات', '143321', '54384', '2024-11-05 17:43:00', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 99 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 380, 320, 320
                    , 320, 320, 320, 320, 320, 960)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+380, netSellCostBuyPrice = netSellCostBuyPrice+320
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+320
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+320
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+320
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+320
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+320
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+320
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+960;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3ce403814 and sellbillId = 143321 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:13:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:43:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:43:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:15:14";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:45:14", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:45:14', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3cf58bb6a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6708,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:42:45', '0672a3cf58bb6a', '6708', '15.00', '1055', '0', '1', '1040.00', '1040', '0', '1040', '1', '2024-11-05 17:45:15', '', '75', '0', 'رانيا كمال I943', '2', '1', '3', '87', 'رانيا كمال I943', '5' ,'0','','','','','-1','0','0','0','0','0','1040','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1055', userid = '75' WHERE clientid = '6708';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6708','15.00','1040','0','اضافة فاتورة مبيعات','143322', '1055', '2024-11-05 17:45:15', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1040', '0', null, '0', null, null,'', '0','1','1','1040','1','2024-11-05 17:42:45','0','0');
UPDATE client SET  inUse = 0 where clientid = 6708;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34858;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','0K793', '143322', '7', '15834', '1', '280', '280', '0', '', '1', '2024-11-05 17:45:15', '15834', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34858-1,','1','1','0','0','280','280','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523935;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15834, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '75', storedetaildate = '2024-11-05 17:45:15' WHERE storedetailid = '15833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15834', '1', '1', '1', '143322', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '75', '2024-11-05 17:45:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34659;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','H1427', '143322', '14', '15730', '1', '430', '430', '0', '', '1', '2024-11-05 17:45:15', '15730', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34659-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 523936;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15730, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 17:45:15' WHERE storedetailid = '15729';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15730', '1', '1', '1', '143322', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 17:45:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34575;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06860', '143322', '5', '15613', '1', '300', '300', '0', '', '1', '2024-11-05 17:45:15', '15613', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34575-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 523937;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15613, '2024-11-05', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 235, 235, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+235
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 17:45:15' WHERE storedetailid = '15612';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15613', '1', '1', '1', '143322', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 17:45:15','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143322', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:45:15', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143322', '17', '10291', '1', '10', '10', '0', '', '1', '2024-11-05 17:45:15', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 6708;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1040, 805, 805
                    , 805, 805, 805, 805
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,805, 805, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+805
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+805
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6708, '2024-11-05', 1040, 805, 805
                    , 805, 805, 805, 805
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,805, 805, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+805
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+805
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1040, 805, 805
                    , 805, 805, 805, 805, 805, 805)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1040, netSellCostBuyPrice = netSellCostBuyPrice+805
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+805
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+805
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+805
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+805
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+805
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+805
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+805;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3cf58bb6a and sellbillId = 143322 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:15:15";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:45:15", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:45:15', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE userid = 2;
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('جينا سعد 41' , '', '', '01284326743', '0', '', '0', '2024-11-05 17:46:12', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10288', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10288','0','0','0','إضافة عميل جديد','10288', '0', '2024-11-05 17:46:12', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('جينا سعد 41', 'جينا سعد 41', 'جينا سعد 41', 'جينا سعد 41', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 17:46:12');
UPDATE client SET clientname = 'جينا سعد 41', clientaddress = '', clientphone = '', clientmobile = '01284326743', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11223',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10288';
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:16:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:46:27", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 17:46:27', '75', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:16:28";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:16:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 17:46:33", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:46:33', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:16:49";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:46:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:46:49', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3d8c1e1e7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10288,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:45:16', '0672a3d8c1e1e7', '10288', '0.00', '323', '0', '1', '323.00', '323', '0', '323', '1', '2024-11-05 17:46:49', '', '75', '0', 'جينا سعد 41', '2', '1', '3', '86', 'جينا سعد 41', '3' ,'0','','','','','-1','0','0','0','0','0','323','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '323', userid = '75' WHERE clientid = '10288';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10288','0.00','323','0','اضافة فاتورة مبيعات','143323', '323', '2024-11-05 17:46:49', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '323', '0', null, '0', null, null,'', '0','1','1','323','1','2024-11-05 17:45:16','0','0');
UPDATE client SET  inUse = 0 where clientid = 10288;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34884;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3235', '143323', '1', '15538', '1', '300', '300', '0', '', '1', '2024-11-05 17:46:49', '15538', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34884-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 208, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523940;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15538, '2024-11-05', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 17:46:49' WHERE storedetailid = '15537';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15538', '1', '1', '1', '143323', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 17:46:49','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143323', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:46:49', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143323', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 17:46:49', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 10288;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 323, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10288, '2024-11-05', 323, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 323, 250, 250
                    , 250, 250, 250, 250, 250, 208)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+323, netSellCostBuyPrice = netSellCostBuyPrice+250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+250
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+250
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+250
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+250
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+208;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3d8c1e1e7 and sellbillId = 143323 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:16:50";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:46:50", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:46:50', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:17:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:47:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:47:01', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3d055fe35
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:43:01', '0672a3d055fe35', '1', '0.00', '0', '0', '1', '2320.00', '2320', '2320', '0', '1', '2024-11-05 17:47:02', '', '9', '0', 'نقدي', '1', '0', '3', '54', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','2320','0','','0','0','2320','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143324', '0', '2024-11-05 17:47:02', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2320', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:43:01','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34292;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('485','H1340', '143324', '14', '15438', '1', '585', '585', '0', '', '1', '2024-11-05 17:47:02', '15438', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34292-1,','1','1','0','0','585','585','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 916.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 916.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 194, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 523943;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15438, '2024-11-05', 585, 485, 485
                    , 916, 485, 916, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+585, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+916
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+916
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 585, 485, 485
                    , 916, 485, 916, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 485, 194, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+585, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+916
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+916
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+194
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 17:47:02' WHERE storedetailid = '15437';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15438', '1', '1', '1', '143324', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 17:47:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34474;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','H1395', '143324', '14', '15610', '1', '300', '300', '0', '', '1', '2024-11-05 17:47:02', '15610', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34474-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        , lastbuyprice_withTax = 210, meanbuyprice_withTax = 210, lastbuyprice_withDiscountAndTax = 210
                where sellbilldetailid = 523944;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15610, '2024-11-05', 300, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+210
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+210
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+210
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+210
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 17:47:02' WHERE storedetailid = '15609';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15610', '1', '1', '1', '143324', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 17:47:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34707;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','06853', '143324', '5', '15607', '1', '580', '580', '0', '', '1', '2024-11-05 17:47:02', '15607', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34707-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 520, lastbuyprice_withDiscountAndTax = 520
                where sellbilldetailid = 523945;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15607, '2024-11-05', 580, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '9', storedetaildate = '2024-11-05 17:47:02' WHERE storedetailid = '15606';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15607', '1', '1', '1', '143324', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '9', '2024-11-05 17:47:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34470;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','06852', '143324', '5', '15606', '1', '570', '570', '0', '', '1', '2024-11-05 17:47:02', '15606', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34470-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 520, lastbuyprice_withDiscountAndTax = 520
                where sellbilldetailid = 523946;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15606, '2024-11-05', 570, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '9', storedetaildate = '2024-11-05 17:47:02' WHERE storedetailid = '15605';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15606', '1', '1', '1', '143324', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '9', '2024-11-05 17:47:02','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33558;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06632', '143324', '5', '15140', '1', '285', '285', '0', '', '1', '2024-11-05 17:47:02', '15140', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33558-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523947;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15140, '2024-11-05', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 17:47:02' WHERE storedetailid = '15139';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15140', '1', '1', '1', '143324', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 17:47:02','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '56704',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('54384','2320', '0', '1', 'اضافة فاتورة مبيعات', '143324', '56704', '2024-11-05 17:47:02', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 54 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2320, 1970, 1970
                    , 2401, 1970, 2401, 1970
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1735, 1444, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2320, sellCostBuyPrice =sellCostBuyPrice+1970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2401
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2401
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1970
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1735
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1444
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 2320, 1970, 1970
                    , 2401, 1970, 2401, 1970
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1735, 1444, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2320, sellCostBuyPrice =sellCostBuyPrice+1970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2401
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2401
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1970
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1735
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1444
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2320, 1970, 1970
                    , 2401, 1970, 2401, 1970, 1735, 1444)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2320, netSellCostBuyPrice = netSellCostBuyPrice+1970
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1970
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2401
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1970
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2401
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1970
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1735
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1444;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3d055fe35 and sellbillId = 143324 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:17:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:47:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:47:02', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:18:16";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:48:16", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:48:16', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13621&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:18:18";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:48:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:48:18', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:18:21";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:48:21", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:48:21', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3dea76316
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2722,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:46:50', '0672a3dea76316', '2722', '-50.00', '374', '0', '1', '424.00', '424', '0', '424', '1', '2024-11-05 17:48:21', '', '75', '0', 'ريم الباهي w341', '2', '1', '3', '83', 'ريم الباهي w341', '4' ,'0','','','','','-1','0','0','0','0','0','424','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '374', userid = '75' WHERE clientid = '2722';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2722','-50.00','424','0','اضافة فاتورة مبيعات','143325', '374', '2024-11-05 17:48:21', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '424', '0', null, '0', null, null,'', '0','1','1','424','1','2024-11-05 17:46:50','0','0');
UPDATE client SET  inUse = 0 where clientid = 2722;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34232;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','R3220', '143325', '1', '15494', '2', '200', '400', '0', '', '1', '2024-11-05 17:48:21', '15494', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34232-2,','1','1','0','0','200','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        
                where sellbilldetailid = 523948;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15494, '2024-11-05', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 17:48:21' WHERE storedetailid = '15493';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15494', '1', '2', '1', '143325', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '3', '75', '2024-11-05 17:48:21','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143325', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:48:21', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143325', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-05 17:48:21', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 2722;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 424, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+424, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2722, '2024-11-05', 424, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+424, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 424, 350, 350
                    , 350, 350, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+424, netSellCostBuyPrice = netSellCostBuyPrice+350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3dea76316 and sellbillId = 143325 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:18:22";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:48:22", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:48:22', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET unitid = '1', productid = '15635', productnumber = '1.00', productunitdate = '2024-10-24', userid = '77', conditions = '0',proUnitParcode='1563501',proUnitSellAllPrice='300',proUnitSellHalfPrice='300',proUnitSellUnitPrice ='300',proUnitBuyPrice='230',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15635';
UPDATE product SET productName = '6861', productDescription = '', productCatId = '5', productBuyPrice = '240', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '0', parcode = '06861',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230.00',lastbuyprice_withDiscount = '230',meanbuyprice = '233',meanbuyprice_withDiscount = '233' , productbuypricereal = '240' , buypricereal_precentage = '0' , buytotal_precentage = '25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='233.33',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',barcodeInTax='',productNameE='',partNumber='0',vehicleType='-1',company='-1',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='226',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '15635';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:19:17";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:49:17", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:49:17', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a3e42e21be', '2024-11-05 17:48:18', '6', '267900.00', '275100', '0', '0', '7200',  '7200', '0', '7200', '1', '2024-11-05 17:49:17', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06508', '13626', '5', '14857', '15', '240', '3600', '0', '', '2024-11-05 17:49:17', '14857','','','0','0','0','0','0',null,'240','3600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:48:18', 1, 14857, 0, 0
                    , 240, 15, 0, 0, 77, '2024-11-05 17:49:17')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:49:17' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('14857', '240', '15', '0', 'buyBillController.php', '31396', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 14857 ;
UPDATE buybilldetail SET  quantitybefore = 15 WHERE buybilldetailid = 31396 ;
UPDATE product SET productName = '6508', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '290.00', productSellUnitPrice = '290.00', productSellHalfPrice = '290.00', productDate = '2024-09-07', conditions = '0', userId = '77', limitamount = '1', parcode = '06508',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '242',meanbuyprice_withDiscount = '242' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='213',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '14857';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 242, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 242
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 213, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31396;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 14857;
UPDATE storedetail SET  productquantity = '30', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '14856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14857', '1', '15', '0', '13626', 'اضافة فاتورة مشتريات', 'buyBillController.php', '15', '30', '77', '2024-11-05 17:48:18','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06861', '13626', '5', '15635', '15', '240', '3600', '0', '', '2024-11-05 17:49:17', '15635','','','0','0','0','0','0',null,'240','3600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:48:18', 1, 15635, 0, 0
                    , 240, 15, 0, 0, 77, '2024-11-05 17:49:17')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:49:17' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15635', '240', '15', '0', 'buyBillController.php', '31397', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15635 ;
UPDATE buybilldetail SET  quantitybefore = 20 WHERE buybilldetailid = 31397 ;
UPDATE product SET productName = '6861', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-24', conditions = '0', userId = '77', limitamount = '0', parcode = '06861',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '236',meanbuyprice_withDiscount = '236' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='233.33',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',barcodeInTax='',productNameE='',partNumber='0',vehicleType='-1',company='-1',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='232',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15635';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 236, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 236
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 232, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31397;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15635;
UPDATE storedetail SET  productquantity = '35', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '15', '0', '13626', 'اضافة فاتورة مشتريات', 'buyBillController.php', '20', '35', '77', '2024-11-05 17:48:18','0','0');
UPDATE supplier SET  suppliercurrentDebt = '275100',suppliercurrentDebtInCurrency= '275100' , userid = '77', supplierdate = '2024-11-05 17:49:17'   WHERE supplierid = '6';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('6', '267900.00', '7200', '0', 'اضافة فاتورة مشتريات', '13626', '275100', '2024-11-05 17:48:18', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','7200','1','267900','7200','275100','0');
update buybill set dailyentryid='0,' where buybillid=13626;
COMMIT;
UPDATE product SET overAllAveragePrice = 240 WHERE productId = 14857;UPDATE product SET overAllAveragePrice = 235 WHERE productId = 15635;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:19:18";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:49:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:49:18', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13626');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:19:21";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:49:21", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:49:21', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13626&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:21:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:51:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:51:46', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3df71a924
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4719,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:47:03', '0672a3df71a924', '4719', '0.00', '838', '0', '1', '838.00', '838', '0', '838', '1', '2024-11-05 17:51:47', '', '9', '0', 'هاجر سيد 2207', '1', '1', '3', '97', 'هاجر سيد 2207', '4' ,'0','','','','','-1','0','0','0','0','0','838','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '838', userid = '9' WHERE clientid = '4719';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4719','0.00','838','0','اضافة فاتورة مبيعات','143326', '838', '2024-11-05 17:51:47', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '838', '0', null, '0', null, null,'', '0','1','1','838','1','2024-11-05 17:47:03','0','0');
UPDATE client SET  inUse = 0 where clientid = 4719;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34384;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06717', '143326', '5', '15245', '1', '320', '320', '0', '', '1', '2024-11-05 17:51:47', '15245', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34384-1,','1','1','0','0','320','320','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 394.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 394.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 173, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523951;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15245, '2024-11-05', 320, 260, 260
                    , 394, 260, 394, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 173, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+394
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+394
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+173
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 320, 260, 260
                    , 394, 260, 394, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 173, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+394
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+394
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+173
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-05 17:51:47' WHERE storedetailid = '15244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15245', '1', '1', '1', '143326', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-05 17:51:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34716;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06879', '143326', '5', '15669', '1', '210', '210', '0', '', '1', '2024-11-05 17:51:47', '15669', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34716-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 523952;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15669, '2024-11-05', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-05 17:51:47' WHERE storedetailid = '15668';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15669', '1', '1', '1', '143326', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-05 17:51:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34730;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','0K787', '143326', '7', '15764', '1', '300', '300', '0', '', '1', '2024-11-05 17:51:47', '15764', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34730-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 523953;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15764, '2024-11-05', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '9', storedetaildate = '2024-11-05 17:51:47' WHERE storedetailid = '15763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15764', '1', '1', '1', '143326', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '9', '2024-11-05 17:51:47','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143326', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-05 17:51:47', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 97 where clientid = 4719;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 838, 650, 650
                    , 784, 650, 784, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,650, 448, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+838, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+784
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+784
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+448
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4719, '2024-11-05', 838, 650, 650
                    , 784, 650, 784, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,650, 448, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+838, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+784
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+784
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+448
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 838, 650, 650
                    , 784, 650, 784, 650, 650, 448)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+838, netSellCostBuyPrice = netSellCostBuyPrice+650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+784
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+650
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+784
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+650
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+448;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3df71a924 and sellbillId = 143326 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:21:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:51:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:51:48', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:22:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:52:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:52:31', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:23:52";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:53:52", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:53:52', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3bc2cdd3e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9984,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:37:38', '0672a3bc2cdd3e', '9984', '-4.00', '4814', '0', '1', '4818.00', '4818', '0', '4818', '1', '2024-11-05 17:53:53', '', '75', '0', 'صابرين سعد07', '2', '1', '3', '100', 'صابرين سعد07', '15' ,'0','','','','','-1','0','0','0','0','0','4818','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '4814', userid = '75' WHERE clientid = '9984';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9984','-4.00','4818','0','اضافة فاتورة مبيعات','143327', '4814', '2024-11-05 17:53:53', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4818', '0', null, '0', null, null,'', '0','1','1','4818','1','2024-11-05 17:37:38','0','0');
UPDATE client SET  inUse = 0 where clientid = 9984;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 18390;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','0H752', '143327', '14', '8654', '1', '610', '610', '0', '', '1', '2024-11-05 17:53:53', '8654', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','18390-1,','1','1','0','0','610','610','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        
                where sellbilldetailid = 523955;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8654, '2024-11-05', 610, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 610, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '8653';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8654', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 17:53:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 28339;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R2588', '143327', '1', '12634', '1', '205', '205', '0', '', '1', '2024-11-05 17:53:53', '12634', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','28339-1,','1','1','0','0','205','205','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        
                where sellbilldetailid = 523956;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12634, '2024-11-05', 205, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+205, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 205, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+205, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '12633';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12634', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 17:53:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('305','S1143', '143327', '3', '12395', '1', '175', '175', '0', '', '1', '2024-11-05 17:53:53', '12395', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','175','175','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 305.00 , meanbuyprice = 305.00, lastbuyprice_withDiscount = 305.00, meanbuyprice_withDiscount = 305.00
        
                where sellbilldetailid = 523957;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12395, '2024-11-05', 175, 305, 305
                    , 305, 305, 305, 305
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+175, sellCostBuyPrice =sellCostBuyPrice+305
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+305, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+305
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+305
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 175, 305, 305
                    , 305, 305, 305, 305
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+175, sellCostBuyPrice =sellCostBuyPrice+305
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+305, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+305
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+305
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '12394';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12395', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-05 17:53:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','05817', '143327', '5', '12871', '1', '120', '120', '0', '', '1', '2024-11-05 17:53:53', '12871', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','120','120','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        
                where sellbilldetailid = 523958;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12871, '2024-11-05', 120, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 120, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '12870';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12871', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 17:53:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33149;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('280','06473', '143327', '5', '14794', '1', '340', '340', '0', '', '1', '2024-11-05 17:53:53', '14794', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33149-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 283.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 283.00
        
                where sellbilldetailid = 523959;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14794, '2024-11-05', 340, 280, 280
                    , 283, 280, 283, 283.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+283
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+283
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340, 280, 280
                    , 283, 280, 283, 283.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+283
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+283
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '14793';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14794', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 17:53:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','R2418', '143327', '1', '11733', '1', '150', '150', '0', '', '1', '2024-11-05 17:53:53', '11733', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 193.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 193.00
        
                where sellbilldetailid = 523960;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11733, '2024-11-05', 150, 190, 190
                    , 193, 190, 193, 191.21
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+193
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+193
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+191.21
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 190, 190
                    , 193, 190, 193, 191.21
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+193
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+193
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+191.21
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '11732';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11733', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 17:53:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33120;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','06540', '143327', '5', '14934', '1', '400', '400', '0', '', '1', '2024-11-05 17:53:53', '14934', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33120-1,','1','1','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 523961;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14934, '2024-11-05', 400, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '14933';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14934', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 17:53:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34198;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','H1359', '143327', '14', '15472', '1', '450', '450', '0', '', '1', '2024-11-05 17:53:53', '15472', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34198-1,','1','1','0','0','450','450','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 523962;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15472, '2024-11-05', 450, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 450, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+450, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '15471';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15472', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 17:53:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34815;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K792', '143327', '7', '15813', '1', '350', '350', '0', '', '1', '2024-11-05 17:53:53', '15813', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34815-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 279.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 279.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 278, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523963;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15813, '2024-11-05', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '34', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '15812';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15813', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '34', '75', '2024-11-05 17:53:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143327', '7', '15694', '2', '350', '700', '0', '', '1', '2024-11-05 17:53:53', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-2,','1','1','0','0','350','700','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 282.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 282.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 523964;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 700, 570, 570
                    , 564, 570, 564, 561.82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 570, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+700, sellCostBuyPrice =sellCostBuyPrice+570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+570, sellCostMeanBuyPrice = sellCostMeanBuyPrice+564
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+564
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+561.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+570
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 700, 570, 570
                    , 564, 570, 564, 561.82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 570, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+700, sellCostBuyPrice =sellCostBuyPrice+570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+570, sellCostMeanBuyPrice = sellCostMeanBuyPrice+564
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+564
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+561.82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+570
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '75', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '2', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '77', '75', '75', '2024-11-05 17:53:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34201;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1356', '143327', '14', '15475', '1', '650', '650', '0', '', '1', '2024-11-05 17:53:53', '15475', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34201-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 591, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 523965;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15475, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '15474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15475', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-05 17:53:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','H1408', '143327', '14', '15693', '1', '600', '600', '0', '', '1', '2024-11-05 17:53:53', '15693', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34605-1,','1','1','0','0','600','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 523966;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15693, '2024-11-05', 600, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 600, 530, 530
                    , 530, 530, 530, 530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 530, 530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-05 17:53:53' WHERE storedetailid = '15692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15693', '1', '1', '1', '143327', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-05 17:53:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143327', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:53:53', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143327', '17', '10291', '1', '48', '48', '0', '', '1', '2024-11-05 17:53:53', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','48','48','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 100 where clientid = 9984;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 4818, 4405, 4405
                    , 4399, 4405, 4399, 4390.11
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1960, 1959, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4818, sellCostBuyPrice =sellCostBuyPrice+4405
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4405, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4399
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4405, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4399
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4390.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1959
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9984, '2024-11-05', 4818, 4405, 4405
                    , 4399, 4405, 4399, 4390.11
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1960, 1959, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4818, sellCostBuyPrice =sellCostBuyPrice+4405
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4405, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4399
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4405, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4399
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4390.11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1959
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4818, 4405, 4405
                    , 4399, 4405, 4399, 4390.11, 1960, 1959)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4818, netSellCostBuyPrice = netSellCostBuyPrice+4405
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4405
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4399
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4405
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4399
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4390.11
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1960
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1959;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3bc2cdd3e and sellbillId = 143327 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:23:54";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:53:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:53:54', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:23:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:53:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:53:55', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3f4004dd2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:52:32', '0672a3f4004dd2', '1', '0.00', '0', '0', '1', '310.00', '310', '310', '0', '1', '2024-11-05 17:53:55', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','310','0','','0','0','310','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143328', '0', '2024-11-05 17:53:55', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '310', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:52:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34668;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06866', '143328', '5', '15640', '1', '310', '310', '0', '', '1', '2024-11-05 17:53:55', '15640', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34668-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523969;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15640, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-05 17:53:55' WHERE storedetailid = '15639';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15640', '1', '1', '1', '143328', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-05 17:53:55','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '57014',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('56704','310', '0', '1', 'اضافة فاتورة مبيعات', '143328', '57014', '2024-11-05 17:53:55', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 310, 250, 250
                    , 250, 250, 250, 250, 250, 250)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+310, netSellCostBuyPrice = netSellCostBuyPrice+250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+250
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+250
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+250
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+250
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+250;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3f4004dd2 and sellbillId = 143328 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:23:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:53:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:53:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:24:38";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:54:38", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:54:38', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3e463a6eb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7055,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:48:22', '0672a3e463a6eb', '7055', '22.00', '325', '0', '1', '303.00', '303', '0', '303', '1', '2024-11-05 17:54:38', '', '75', '0', 'مصطفي ابراهيم U43', '2', '1', '3', '91', 'مصطفي ابراهيم U43', '2' ,'0','','','','','-1','0','0','0','0','0','303','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '325', userid = '75' WHERE clientid = '7055';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7055','22.00','303','0','اضافة فاتورة مبيعات','143329', '325', '2024-11-05 17:54:38', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '303', '0', null, '0', null, null,'', '0','1','1','303','1','2024-11-05 17:48:22','0','0');
UPDATE client SET  inUse = 0 where clientid = 7055;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34776;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06922', '143329', '5', '15789', '1', '300', '300', '0', '', '1', '2024-11-05 17:54:38', '15789', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34776-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 523970;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15789, '2024-11-05', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-05 17:54:38' WHERE storedetailid = '15788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15789', '1', '1', '1', '143329', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-05 17:54:38','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143329', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 17:54:38', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 7055;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 303, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7055, '2024-11-05', 303, 245, 245
                    , 245, 245, 245, 245
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,245, 245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+245
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+245
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+245
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 303, 245, 245
                    , 245, 245, 245, 245, 245, 245)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+303, netSellCostBuyPrice = netSellCostBuyPrice+245
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+245
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+245
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+245
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+245
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+245
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+245
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+245;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3e463a6eb and sellbillId = 143329 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:24:39";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:54:39", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:54:39', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:24:48";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:54:48", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:54:48', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13626&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:24:50";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:54:50", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:54:50', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:25:26";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:55:26", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:55:26', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('حنين احمد 43' , '', '', '01098045725', '0', '', '0', '2024-11-05 17:55:38', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10289', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10289','0','0','0','إضافة عميل جديد','10289', '0', '2024-11-05 17:55:38', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('حنين احمد 43', 'حنين احمد 43', 'حنين احمد 43', 'حنين احمد 43', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 17:55:38');
UPDATE client SET clientname = 'حنين احمد 43', clientaddress = '', clientphone = '', clientmobile = '01098045725', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11224',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10289';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:25:49";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:55:49", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:55:49', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a3fee675bf', '2024-11-05 17:55:26', '19', '218800.00', '228700', '0', '0', '9900',  '9900', '0', '9900', '1', '2024-11-05 17:55:49', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06947', '13627', '5', '15875', '20', '495', '9900', '0', '', '2024-11-05 17:55:49', '15875','','','0','0','0','0','0',null,'495','9900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 17:55:26', 1, 15875, 0, 0
                    , 495, 20, 0, 0, 77, '2024-11-05 17:55:49')
                ON DUPLICATE KEY UPDATE buyprice = 495,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 17:55:49' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15875', '495', '20', '0', 'buyBillController.php', '31398', '', '0', '0');
UPDATE product SET  productBuyPrice = "495" WHERE productId = 15875 ;
UPDATE buybilldetail SET  quantitybefore = 10 WHERE buybilldetailid = 31398 ;
UPDATE product SET productName = '6947', productDescription = '', productCatId = '5', productBuyPrice = '495.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06947',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '495',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '495.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='495',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='495',meanbuyprice_withTax='495',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='495'  WHERE productId = '15875';
UPDATE buybilldetail SET  lastbuyprice = 495 , meanbuyprice = 495, lastbuyprice_withDiscount = 495, meanbuyprice_withDiscount = 495
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where buybilldetailid = 31398;
UPDATE productunit SET proUnitBuyPrice  = 495 * productnumber WHERE productid = 15875;
UPDATE storedetail SET  productquantity = '30', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15874';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15875', '1', '20', '0', '13627', 'اضافة فاتورة مشتريات', 'buyBillController.php', '10', '30', '77', '2024-11-05 17:55:26','0','0');
UPDATE supplier SET  suppliercurrentDebt = '228700',suppliercurrentDebtInCurrency= '228700' , userid = '77', supplierdate = '2024-11-05 17:55:49'   WHERE supplierid = '19';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('19', '218800.00', '9900', '0', 'اضافة فاتورة مشتريات', '13627', '228700', '2024-11-05 17:55:26', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','9900','1','218800','9900','228700','0');
update buybill set dailyentryid='0,' where buybillid=13627;
COMMIT;
UPDATE product SET overAllAveragePrice = 495 WHERE productId = 15875;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:25:50";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:55:50", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 17:55:50', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13627');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:26:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:56:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 17:56:03', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:26:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:56:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 17:56:10', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'نفحة', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '56964',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('57014.00','50', '1', '1', 'إضافة مصروف', '24290', '56964', '2024-11-05 17:56:10', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'نفحة', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24290';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:26:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:56:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 17:56:10', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:26:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:56:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 17:56:12', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:26:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:56:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:56:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:26:27";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:56:27", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:56:27', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3fbf853ac
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10289,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:54:39', '0672a3fbf853ac', '10289', '0.00', '778', '0', '1', '778.00', '778', '0', '778', '1', '2024-11-05 17:56:27', '', '75', '0', 'حنين احمد 43', '2', '1', '3', '91', 'حنين احمد 43', '4' ,'0','','','','','-1','0','0','0','0','0','778','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '778', userid = '75' WHERE clientid = '10289';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10289','0.00','778','0','اضافة فاتورة مبيعات','143330', '778', '2024-11-05 17:56:27', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '778', '0', null, '0', null, null,'', '0','1','1','778','1','2024-11-05 17:54:39','0','0');
UPDATE client SET  inUse = 0 where clientid = 10289;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34625;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06892', '143330', '5', '15700', '1', '270', '270', '0', '', '1', '2024-11-05 17:56:27', '15700', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34625-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523972;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15700, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '42', userid = '75', storedetaildate = '2024-11-05 17:56:27' WHERE storedetailid = '15699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15700', '1', '1', '1', '143330', 'اضافة فاتورة مبيعات', 'sellbillController.php', '43', '42', '75', '2024-11-05 17:56:27','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143330', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-05 17:56:27', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523973;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '59', userid = '75', storedetaildate = '2024-11-05 17:56:27' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143330', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '59', '75', '2024-11-05 17:56:27','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143330', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 17:56:27', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143330', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-05 17:56:27', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 10289;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 778, 640, 640
                    , 640, 640, 640, 640
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,640, 640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+778, sellCostBuyPrice =sellCostBuyPrice+640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10289, '2024-11-05', 778, 640, 640
                    , 640, 640, 640, 640
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,640, 640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+778, sellCostBuyPrice =sellCostBuyPrice+640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 778, 640, 640
                    , 640, 640, 640, 640, 640, 640)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+778, netSellCostBuyPrice = netSellCostBuyPrice+640
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+640
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+640
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+640
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+640
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+640
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+640
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+640;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3fbf853ac and sellbillId = 143330 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:26:28";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 17:56:28", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:56:28', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:27:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 17:57:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 17:57:15', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13627&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:27:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:57:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:57:16', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a40203f94c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:56:16', '0672a40203f94c', '1', '0.00', '0', '0', '1', '200.00', '200', '200', '0', '1', '2024-11-05 17:57:16', '', '9', '0', 'نقدي', '1', '0', '3', '54', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','200','0','','0','0','200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143331', '0', '2024-11-05 17:57:16', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '200', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:56:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34536;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06786', '143331', '5', '15389', '1', '200', '200', '0', '', '1', '2024-11-05 17:57:16', '15389', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34536-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 523976;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-05', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '9', storedetaildate = '2024-11-05 17:57:16' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '1', '143331', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '9', '2024-11-05 17:57:16','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '57164',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('56964','200', '0', '1', 'اضافة فاتورة مبيعات', '143331', '57164', '2024-11-05 17:57:16', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 54 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 149, 150, 149, 146.67
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 122, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+149
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+149
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+146.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+122
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 200, 150, 150
                    , 149, 150, 149, 146.67, 150, 122)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+200, netSellCostBuyPrice = netSellCostBuyPrice+150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+150
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+149
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+150
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+149
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+146.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+150
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+122;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a40203f94c and sellbillId = 143331 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:27:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:57:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:57:17', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:28:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:58:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:58:43', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a405d2d1c2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:57:17', '0672a405d2d1c2', '1', '0.00', '0', '0', '1', '730.00', '730', '730', '0', '1', '2024-11-05 17:58:43', '', '9', '0', 'نقدي', '1', '0', '3', '24', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','730','0','','0','0','730','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143332', '0', '2024-11-05 17:58:43', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '730', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:57:17','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30431;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','06081', '143332', '5', '13658', '1', '430', '430', '0', '', '1', '2024-11-05 17:58:43', '13658', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30431-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 523977;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13658, '2024-11-05', 430, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-05 17:58:43' WHERE storedetailid = '13657';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13658', '1', '1', '1', '143332', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-05 17:58:43','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34728;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3270', '143332', '1', '15762', '1', '300', '300', '0', '', '1', '2024-11-05 17:58:43', '15762', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34728-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 125, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523978;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15762, '2024-11-05', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '9', storedetaildate = '2024-11-05 17:58:43' WHERE storedetailid = '15761';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15762', '1', '1', '1', '143332', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '9', '2024-11-05 17:58:43','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '57894',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('57164','730', '0', '1', 'اضافة فاتورة مبيعات', '143332', '57894', '2024-11-05 17:58:43', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 24 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 730, 630, 630
                    , 630, 630, 630, 630
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+730, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+630
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+630, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+630
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+630
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 730, 630, 630
                    , 630, 630, 630, 630
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+730, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+630
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+630, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+630
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+630
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 730, 630, 630
                    , 630, 630, 630, 630, 250, 125)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+730, netSellCostBuyPrice = netSellCostBuyPrice+630
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+630
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+630
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+630
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+630
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+630
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+125;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a405d2d1c2 and sellbillId = 143332 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:28:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 17:58:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 17:58:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:30:15";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:00:15", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:00:15', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a40b416539
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:58:44', '0672a40b416539', '1', '0.00', '0', '0', '1', '960.00', '960', '960', '0', '1', '2024-11-05 18:00:15', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','960','0','','0','0','960','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143333', '0', '2024-11-05 18:00:15', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '960', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:58:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34423;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('485','R3225', '143333', '1', '15517', '1', '570', '570', '0', '', '1', '2024-11-05 18:00:15', '15517', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34423-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        
                where sellbilldetailid = 523979;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15517, '2024-11-05', 570, 485, 485
                    , 485, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 485, 485
                    , 485, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 18:00:15' WHERE storedetailid = '15516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15517', '1', '1', '1', '143333', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 18:00:15','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34543;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','R3240', '143333', '1', '15650', '1', '390', '390', '0', '', '1', '2024-11-05 18:00:16', '15650', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34543-1,','1','1','0','0','390','390','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 523980;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15650, '2024-11-05', 390, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 390, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 18:00:16' WHERE storedetailid = '15649';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15650', '1', '1', '1', '143333', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 18:00:16','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '58854',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('57894','960', '0', '1', 'اضافة فاتورة مبيعات', '143333', '58854', '2024-11-05 18:00:16', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 960, 815, 815
                    , 815, 815, 815, 815
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+815, sellCostMeanBuyPrice = sellCostMeanBuyPrice+815
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+815
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+815
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 960, 815, 815
                    , 815, 815, 815, 815
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+815, sellCostMeanBuyPrice = sellCostMeanBuyPrice+815
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+815
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+815
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 960, 815, 815
                    , 815, 815, 815, 815, 330, 330)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+960, netSellCostBuyPrice = netSellCostBuyPrice+815
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+815
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+815
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+815
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+815
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+815
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+330;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a40b416539 and sellbillId = 143333 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:30:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:00:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:00:16', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:31:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:01:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:01:39', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4110b0bf6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:00:16', '0672a4110b0bf6', '1', '0.00', '0', '0', '1', '520.00', '520', '520', '0', '1', '2024-11-05 18:01:39', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','520','0','','0','0','520','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143334', '0', '2024-11-05 18:01:39', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '520', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:00:16','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34875;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1457', '143334', '14', '15841', '1', '520', '520', '0', '', '1', '2024-11-05 18:01:39', '15841', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34875-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523981;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15841, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-05 18:01:39' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '1', '1', '143334', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-05 18:01:39','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '59374',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('58854','520', '0', '1', 'اضافة فاتورة مبيعات', '143334', '59374', '2024-11-05 18:01:39', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 520, 410, 410
                    , 410, 410, 410, 410, 410, 410)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+520, netSellCostBuyPrice = netSellCostBuyPrice+410
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+410
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+410
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+410
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+410
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+410
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+410
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+410;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4110b0bf6 and sellbillId = 143334 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:31:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:01:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:01:39', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:34:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:04:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:04:41', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4163eb2a5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7907,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:01:39', '0672a4163eb2a5', '7907', '16.00', '1273', '16', '1', '1273.00', '1257', '0', '1257', '1', '2024-11-05 18:04:41', '', '9', '0', 'شيماء الزناتي x225', '1', '1', '3', '54', 'شيماء الزناتي x225', '5' ,'0','','','','','-1','0','0','0','0','0','1257','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1273', userid = '9' WHERE clientid = '7907';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7907','16.00','1257','0','اضافة فاتورة مبيعات','143335', '1273', '2024-11-05 18:04:41', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1257', '0', null, '0', null, null,'', '0','1','1','1257','1','2024-11-05 18:01:39','0','0');
UPDATE client SET  inUse = 0 where clientid = 7907;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','H1217', '143335', '14', '10460', '1', '300', '300', '0', '', '1', '2024-11-05 18:04:41', '10460', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 209.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 209.00
        
                where sellbilldetailid = 523982;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10460, '2024-11-05', 296.2293794187, 210, 210
                    , 209, 210, 209, 197.22
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+296.2293794187, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+209
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+209
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+197.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 296.2293794187, 210, 210
                    , 209, 210, 209, 197.22
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+296.2293794187, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+209
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+209
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+197.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '9', storedetaildate = '2024-11-05 18:04:41' WHERE storedetailid = '10459';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10460', '1', '1', '1', '143335', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '9', '2024-11-05 18:04:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32675;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','R3046', '143335', '1', '14724', '1', '370', '370', '0', '', '1', '2024-11-05 18:04:41', '14724', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32675-1,','1','1','0','0','370','370','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        
                where sellbilldetailid = 523983;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14724, '2024-11-05', 365.34956794973, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+365.34956794973, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 365.34956794973, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+365.34956794973, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-05 18:04:41' WHERE storedetailid = '14723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14724', '1', '1', '1', '143335', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-05 18:04:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33289;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R3119', '143335', '1', '15063', '1', '300', '300', '0', '', '1', '2024-11-05 18:04:41', '15063', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33289-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 523984;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15063, '2024-11-05', 296.2293794187, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+296.2293794187, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 296.2293794187, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+296.2293794187, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 18:04:41' WHERE storedetailid = '15062';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15063', '1', '1', '1', '143335', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 18:04:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34491;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06508', '143335', '5', '14857', '1', '290', '290', '0', '', '1', '2024-11-05 18:04:41', '14857', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34491-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 242.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 242.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 213, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 523985;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14857, '2024-11-05', 286.35506677141, 240, 240
                    , 242, 240, 242, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 213, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+286.35506677141, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+242
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+213
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 286.35506677141, 240, 240
                    , 242, 240, 242, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 213, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+286.35506677141, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+242
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+213
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '9', storedetaildate = '2024-11-05 18:04:41' WHERE storedetailid = '14856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14857', '1', '1', '1', '143335', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '9', '2024-11-05 18:04:41','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143335', '17', '10291', '1', '13', '13', '0', '', '1', '2024-11-05 18:04:41', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','13','13','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 54 where clientid = 7907;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1257, 1000, 1000
                    , 1001, 1000, 1001, 987.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 213, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1257, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1001
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1001
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+987.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+213
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7907, '2024-11-05', 1257, 1000, 1000
                    , 1001, 1000, 1001, 987.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 213, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1257, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1001
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1001
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+987.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+213
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1257, 1000, 1000
                    , 1001, 1000, 1001, 987.22, 240, 213)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1257, netSellCostBuyPrice = netSellCostBuyPrice+1000
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1000
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1001
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1000
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1001
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+987.22
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+213;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4163eb2a5 and sellbillId = 143335 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:34:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:04:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:04:42', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:37:42";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:07:42", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 18:07:42', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:37:53";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:07:53", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:07:53', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3dd934624
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(280,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:46:33', '0672a3dd934624', '280', '0.00', '9520', '0', '1', '9520.00', '9520', '0', '9520', '1', '2024-11-05 18:07:53', '', '75', '0', 'بسمة ابو المجد', '2', '1', '3', '79', 'بسمة ابو المجد', '29' ,'0','','','','','-1','0','0','0','0','0','9520','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '9520', userid = '75' WHERE clientid = '280';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('280','0.00','9520','0','اضافة فاتورة مبيعات','143336', '9520', '2024-11-05 18:07:53', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '9520', '0', null, '0', null, null,'', '0','1','1','9520','1','2024-11-05 17:46:33','0','0');
UPDATE client SET  inUse = 0 where clientid = 280;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34130;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1335', '143336', '14', '15405', '1', '820', '820', '0', '', '1', '2024-11-05 18:07:53', '15405', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34130-1,','1','1','0','0','820','820','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        
                where sellbilldetailid = 523987;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15405, '2024-11-05', 820, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 820, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 18:07:53' WHERE storedetailid = '15404';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15405', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 18:07:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','R2594', '143336', '1', '12647', '1', '140', '140', '0', '', '1', '2024-11-05 18:07:53', '12647', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','140','140','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 293.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 293.00
        
                where sellbilldetailid = 523988;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12647, '2024-11-05', 140, 220, 220
                    , 293, 220, 293, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+293
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+293
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 140, 220, 220
                    , 293, 220, 293, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+293
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+293
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 18:07:53' WHERE storedetailid = '12646';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12647', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 18:07:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34517;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3262', '143336', '1', '15636', '1', '220', '220', '0', '', '1', '2024-11-05 18:07:53', '15636', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34517-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 523989;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15636, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-05 18:07:53' WHERE storedetailid = '15635';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15636', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-05 18:07:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34393;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','R3199', '143336', '1', '15402', '2', '310', '620', '0', '', '1', '2024-11-05 18:07:53', '15402', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34393-2,','1','1','0','0','310','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 193, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 523990;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15402, '2024-11-05', 620, 520, 520
                    , 520, 520, 520, 517.14
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 520, 386, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+517.14
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+386
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 520, 520
                    , 520, 520, 520, 517.14
                    , 0, 0, 0, 0
                    , 0, 0, 0, 520, 386, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+517.14
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+386
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '75', storedetaildate = '2024-11-05 18:07:53' WHERE storedetailid = '15401';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15402', '1', '2', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '23', '75', '2024-11-05 18:07:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34639;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1425', '143336', '14', '15712', '1', '510', '510', '0', '', '1', '2024-11-05 18:07:53', '15712', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34639-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523991;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15712, '2024-11-05', 510, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 510, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-05 18:07:53' WHERE storedetailid = '15711';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15712', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-05 18:07:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34875;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','H1457', '143336', '14', '15841', '1', '520', '520', '0', '', '1', '2024-11-05 18:07:53', '15841', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34875-1,','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 523992;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15841, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '75', storedetaildate = '2024-11-05 18:07:53' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '23', '75', '2024-11-05 18:07:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34783;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1416', '143336', '14', '15796', '1', '430', '430', '0', '', '1', '2024-11-05 18:07:54', '15796', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34783-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 523993;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15796, '2024-11-05', 430, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15795';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15796', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32545;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06437', '143336', '5', '14649', '1', '245', '245', '0', '', '1', '2024-11-05 18:07:54', '14649', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32545-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 523994;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14649, '2024-11-05', 245, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 245, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '14648';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14649', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34813;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06935', '143336', '5', '15812', '1', '210', '210', '0', '', '1', '2024-11-05 18:07:54', '15812', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34813-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where sellbilldetailid = 523995;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15812, '2024-11-05', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15811';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15812', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143336', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-05 18:07:54', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 523996;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '58', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '59', '58', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34675;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','R3269', '143336', '1', '15742', '1', '250', '250', '0', '', '1', '2024-11-05 18:07:54', '15742', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34675-1,','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 100, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 523997;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15742, '2024-11-05', 250, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 200, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 250, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15741';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15742', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34827;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06945', '143336', '5', '15824', '1', '310', '310', '0', '', '1', '2024-11-05 18:07:54', '15824', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34827-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 523998;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15824, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15823';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15824', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34807;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06931', '143336', '5', '15806', '1', '210', '210', '0', '', '1', '2024-11-05 18:07:54', '15806', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34807-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where sellbilldetailid = 523999;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15806, '2024-11-05', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15805';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15806', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '29', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32424;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06371', '143336', '5', '14474', '1', '380', '380', '0', '', '1', '2024-11-05 18:07:54', '14474', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32424-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 524000;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14474, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '14473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14474', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30141;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','B1174', '143336', '2', '13366', '1', '195', '195', '0', '', '1', '2024-11-05 18:07:54', '13366', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30141-1,','1','1','0','0','195','195','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 524001;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13366, '2024-11-05', 195, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 195, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+195, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '13365';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13366', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34556;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','06877', '143336', '5', '15668', '1', '240', '240', '0', '', '1', '2024-11-05 18:07:54', '15668', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34556-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 524002;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15668, '2024-11-05', 240, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15667';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15668', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30917;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','B1190', '143336', '2', '13467', '1', '185', '185', '0', '', '1', '2024-11-05 18:07:54', '13467', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30917-1,','1','1','0','0','185','185','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 524003;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13467, '2024-11-05', 185, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '13466';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13467', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143336', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-05 18:07:54', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 282.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 282.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 524004;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 285, 285
                    , 282, 285, 282, 280.91
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280.91
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '74', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '75', '74', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34666;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','06907', '143336', '5', '15734', '1', '230', '230', '0', '', '1', '2024-11-05 18:07:54', '15734', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34666-1,','1','1','0','0','230','230','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        , lastbuyprice_withTax = 170, meanbuyprice_withTax = 170, lastbuyprice_withDiscountAndTax = 170
                where sellbilldetailid = 524005;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15734, '2024-11-05', 230, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 170, 170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 230, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 170, 170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+230, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15733';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15734', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32700;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06435', '143336', '5', '14650', '1', '240', '240', '0', '', '1', '2024-11-05 18:07:54', '14650', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32700-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 524006;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14650, '2024-11-05', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '14649';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14650', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32049;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','R2806', '143336', '1', '13988', '1', '170', '170', '0', '', '1', '2024-11-05 18:07:54', '13988', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32049-1,','1','1','0','0','170','170','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 196.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 196.00
        
                where sellbilldetailid = 524007;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13988, '2024-11-05', 170, 195, 195
                    , 196, 195, 196, 196
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+196
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+196
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 170, 195, 195
                    , 196, 195, 196, 196
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+196
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+196
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '13987';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13988', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30638;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R2775', '143336', '1', '13780', '1', '245', '245', '0', '', '1', '2024-11-05 18:07:54', '13780', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30638-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 524008;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13780, '2024-11-05', 245, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 245, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '13779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13780', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31696;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','R2833', '143336', '1', '14138', '1', '210', '210', '0', '', '1', '2024-11-05 18:07:54', '14138', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31696-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 197.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 197.00
        
                where sellbilldetailid = 524009;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14138, '2024-11-05', 210, 195, 195
                    , 197, 195, 197, 196.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+197
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+197
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 195, 195
                    , 197, 195, 197, 196.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+197
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+197
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+196.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '14137';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14138', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34359;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1367', '143336', '14', '15532', '1', '480', '480', '0', '', '1', '2024-11-05 18:07:54', '15532', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34359-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        
                where sellbilldetailid = 524010;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15532, '2024-11-05', 480, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15531';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15532', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34780;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','H1414', '143336', '14', '15793', '1', '800', '800', '0', '', '1', '2024-11-05 18:07:54', '15793', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34780-1,','1','1','0','0','800','800','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 524011;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15793, '2024-11-05', 800, 580, 580
                    , 580, 580, 580, 580
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 580, 580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+580
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 800, 580, 580
                    , 580, 580, 580, 580
                    , 0, 0, 0, 0
                    , 0, 0, 0, 580, 580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+580
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15792';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15793', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 18:07:54','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34779;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('480','H1413', '143336', '14', '15792', '1', '710', '710', '0', '', '1', '2024-11-05 18:07:54', '15792', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34779-1,','1','1','0','0','710','710','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 480.00
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 480
                where sellbilldetailid = 524012;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15792, '2024-11-05', 710, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 480, 480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 710, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 480, 480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 18:07:54' WHERE storedetailid = '15791';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15792', '1', '1', '1', '143336', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 18:07:54','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143336', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:07:54', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143336', '17', '10291', '1', '100', '100', '0', '', '1', '2024-11-05 18:07:54', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 280;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 9520, 8510, 8510
                    , 8583, 8510, 8583, 8505.38
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5060, 4821, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9520, sellCostBuyPrice =sellCostBuyPrice+8510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8583
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8583
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8505.38
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5060
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4821
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (280, '2024-11-05', 9520, 8510, 8510
                    , 8583, 8510, 8583, 8505.38
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5060, 4821, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9520, sellCostBuyPrice =sellCostBuyPrice+8510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8583
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8583
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8505.38
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5060
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4821
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 9520, 8510, 8510
                    , 8583, 8510, 8583, 8505.38, 5060, 4821)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+9520, netSellCostBuyPrice = netSellCostBuyPrice+8510
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8510
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8583
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8510
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8583
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8505.38
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5060
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4821;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3dd934624 and sellbillId = 143336 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:37:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:07:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:07:55', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE userid = 75;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:13";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:08:13", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 18:08:13', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =235976
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3677,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-14575' , clientdate = '2024-11-05 18:08:13', userid = '9' WHERE clientid = '3677';
UPDATE client SET  inUse = 0 where clientid = 3677;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3677','-14090.00','485','1','ايصال تحصيل (( قبض من عميل ))','235976', '-14575', '2024-11-05 18:07:42', '9', 'clientPayedDeptController.php', '   دونز', '485', '0', null, '0', null, null,'', '-1','1','1','485','1','','818','0');
UPDATE save SET  savecurrentvalue = '59859',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('59374.00','485', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '235977', '59859', '2024-11-05 18:08:13', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '485', '485', '2024-11-05', '9', '0', '0', '2024-11-05 18:08:14','اضافة ايصال سداد للعميل زيادة ','1','0','0','0','235977','clientPayedDeptController.php?do=show&id=235977');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118969', '-1', '485', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '485', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118969', '-1', '485', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-485', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3677', clientdebtchangebefore = '-14090.000', clientdebtchangeamount = '485.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '235976', clientdebtchangeafter = '-14575.000', clientdebtchangedate = '2024-11-05 18:07:42', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   دونز', totalOperationCost = '485.00',discount='', reciptid='0', dailyentryid = '118969',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='485',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '235977';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =235976 -clientdebtchangeId = 235977
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:14";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:08:14", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 18:08:14', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:08:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 18:08:16', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:08:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 18:08:16', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:16";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:20";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:08:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 18:08:20', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:08:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 18:08:23', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:34";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:08:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:08:34', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:08:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:08:45', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:38:58";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:08:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:08:58', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=142572');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:39:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:09:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:09:24', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 142572 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 142572 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 142572;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 18:09:24', userid = '101',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '142572';
UPDATE sellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 464.00, meanbuyprice_withDiscount = 465.00
        
                where sellbilldetailid = 521049;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9691, '2024-11-05', 500, 475, 475
                    , 475, 464, 465, 473.44
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-475, sellCostMeanBuyPrice = sellCostMeanBuyPrice-475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-464, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-473.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 475, 475
                    , 475, 464, 465, 473.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-475, sellCostMeanBuyPrice = sellCostMeanBuyPrice-475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-464, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-473.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '9690';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9691', '1', '1', '0', '142572', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '7', '2', '2024-10-31 14:57:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34428;
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 521050;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-61
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-61
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '13', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '0', '142572', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '13', '2', '2024-10-31 14:57:11','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        
                where sellbilldetailid = 521051;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10353, '2024-11-05', 200, 200, 200
                    , 200, 200, 200, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 200, 200
                    , 200, 200, 200, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '-4', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '10352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10353', '1', '1', '0', '142572', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-5', '-4', '2', '2024-10-31 14:57:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31670;
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        
                where sellbilldetailid = 521052;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14240, '2024-11-05', 100, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-100, sellCostBuyPrice =sellCostBuyPrice-195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-195, sellCostMeanBuyPrice = sellCostMeanBuyPrice-195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 100, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-100, sellCostBuyPrice =sellCostBuyPrice-195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-195, sellCostMeanBuyPrice = sellCostMeanBuyPrice-195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '14239';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14240', '1', '1', '0', '142572', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-10-31 14:57:11','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31551;
UPDATE sellbilldetail SET  lastbuyprice = 65.00 , meanbuyprice = 65.00, lastbuyprice_withDiscount = 65.00, meanbuyprice_withDiscount = 65.00
        
                where sellbilldetailid = 521053;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14002, '2024-11-05', 90, 65, 65
                    , 65, 65, 65, 64.67
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-90, sellCostBuyPrice =sellCostBuyPrice-65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-65, sellCostMeanBuyPrice = sellCostMeanBuyPrice-65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-64.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 90, 65, 65
                    , 65, 65, 65, 64.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-90, sellCostBuyPrice =sellCostBuyPrice-65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-65, sellCostMeanBuyPrice = sellCostMeanBuyPrice-65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-64.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '14001';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14002', '1', '1', '0', '142572', 'تعديل فاتورة مبيعات', 'sellbillController.php', '11', '12', '2', '2024-10-31 14:57:11','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 521054;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14095, '2024-11-05', 520, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-520, sellCostBuyPrice =sellCostBuyPrice-495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-495, sellCostMeanBuyPrice = sellCostMeanBuyPrice-495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-520, sellCostBuyPrice =sellCostBuyPrice-495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-495, sellCostMeanBuyPrice = sellCostMeanBuyPrice-495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '14094';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14095', '1', '1', '0', '142572', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1', '2', '2', '2024-10-31 14:57:11','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 411.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 411.00
        
                where sellbilldetailid = 521055;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9780, '2024-11-05', 460, 350, 350
                    , 411, 350, 411, 372.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-460, sellCostBuyPrice =sellCostBuyPrice-350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-411
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-411
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-372.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 460, 350, 350
                    , 411, 350, 411, 372.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-460, sellCostBuyPrice =sellCostBuyPrice-350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-411
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-411
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-372.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '11', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '9779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9780', '1', '1', '0', '142572', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '11', '2', '2024-10-31 14:57:11','0','0');
CALL clientInUse(2868,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-1835', userid = '2' WHERE clientid = '2868';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2868','276.00','2111.00','1','تعديل فاتورة مبيعات','142572', '-1835', '2024-10-31 14:57:11', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '2111', '0', null, '0', null, null,'', '0','1','1','2111','1','2024-10-31 14:57:11','0','0');
UPDATE client SET  inUse = 0 where clientid = 2868;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2111, 1930, 1930
                    , 1991, 1919, 1981, 1750.61
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2111, sellCostBuyPrice =sellCostBuyPrice-1930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1930, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1991
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1919, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1981
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1750.61
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-61
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2868, '2024-11-05', 2111, 1930, 1930
                    , 1991, 1919, 1981, 1750.61
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2111, sellCostBuyPrice =sellCostBuyPrice-1930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1930, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1991
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1919, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1981
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1750.61
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-61
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2111, 1930, 1930
                    , 1991, 1919, 1981, 1750.61, 150, 61)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-2111, netSellCostBuyPrice = netSellCostBuyPrice-1930
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1930
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1991
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1919
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1981
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1750.61
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-150
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-61;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 142572 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 142572 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(2868,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-10-31 14:57:11', '0672370978e0c3', '2868', '-1835.00', '76', '0', '1', '1911', '1911', '0', '1911', '1', '2024-10-31 14:57:11', '', '2', '0', 'سمر جمال E42', '2', '1', '3', '82', 'سمر جمال E42', '8', '142572', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-10-31','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '76', userid = '2' WHERE clientid = '2868';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2868','-1835.00','1911','0','اضافة فاتورة مبيعات (معدله)','143337', '76', '2024-11-05 18:09:24', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '1911', '0', null, '0', null, null,'', '0','1','1','2111','1','2024-10-31 14:57:11','0','0');
UPDATE client SET  inUse = 0 where clientid = 2868;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('475','H1120', '143337', '14', '9691', '1', '500', '500', '0', '', '1', '2024-11-05 18:09:24', '9691', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 464.00, meanbuyprice_withDiscount = 465.00
        
                where sellbilldetailid = 524015;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9691, '2024-11-05', 500, 475, 475
                    , 475, 464, 465, 473.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+464, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+473.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 475, 475
                    , 475, 464, 465, 473.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+475
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+464, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+473.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '9690';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9691', '1', '1', '1', '143337', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '7', '6', '2', '2024-11-05 18:09:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34428;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06813', '143337', '5', '15496', '1', '200', '200', '0', '', '1', '2024-11-05 18:09:24', '15496', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34428-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 61, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 524016;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15496, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '15495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15496', '1', '1', '1', '143337', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '13', '12', '2', '2024-11-05 18:09:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31670;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','14240', '143337', '20', '14240', '1', '100', '100', '0', '', '1', '2024-11-05 18:09:24', '14240', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31670-1,','1','1','0','0','100','100','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        
                where sellbilldetailid = 524017;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14240, '2024-11-05', 100, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 100, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '14239';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14240', '1', '1', '1', '143337', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '2', '2024-11-05 18:09:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31551;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('65','00lb5', '143337', '20', '14002', '1', '90', '90', '0', '', '1', '2024-11-05 18:09:24', '14002', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31551-1,','1','1','0','0','90','90','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 65.00 , meanbuyprice = 65.00, lastbuyprice_withDiscount = 65.00, meanbuyprice_withDiscount = 65.00
        
                where sellbilldetailid = 524018;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14002, '2024-11-05', 90, 65, 65
                    , 65, 65, 65, 64.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+90, sellCostBuyPrice =sellCostBuyPrice+65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+65, sellCostMeanBuyPrice = sellCostMeanBuyPrice+65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+64.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 90, 65, 65
                    , 65, 65, 65, 64.67
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+90, sellCostBuyPrice =sellCostBuyPrice+65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+65, sellCostMeanBuyPrice = sellCostMeanBuyPrice+65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+64.67
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '14001';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14002', '1', '1', '1', '143337', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '11', '2', '2024-11-05 18:09:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06198', '143337', '5', '14095', '1', '520', '520', '0', '', '1', '2024-11-05 18:09:24', '14095', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','520','520','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 524019;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14095, '2024-11-05', 520, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 520, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+520, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 18:09:24' WHERE storedetailid = '14094';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14095', '1', '1', '1', '143337', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2', '1', '2', '2024-11-05 18:09:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','H1143', '143337', '14', '9780', '1', '460', '460', '0', '', '1', '2024-11-05 18:09:25', '9780', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','460','460','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 411.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 411.00
        
                where sellbilldetailid = 524020;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9780, '2024-11-05', 460, 350, 350
                    , 411, 350, 411, 372.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+411
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+411
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+372.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 460, 350, 350
                    , 411, 350, 411, 372.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+411
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+411
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+372.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2024-11-05 18:09:25' WHERE storedetailid = '9779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9780', '1', '1', '1', '143337', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '11', '10', '2', '2024-11-05 18:09:25','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143337', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:09:25', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143337', '17', '10291', '1', '21', '21', '0', '', '1', '2024-11-05 18:09:25', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','21','21','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1911, 1730, 1730
                    , 1791, 1719, 1781, 1750.61
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1911, sellCostBuyPrice =sellCostBuyPrice+1730
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1730, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1791
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1719, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1781
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1750.61
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2868, '2024-11-05', 1911, 1730, 1730
                    , 1791, 1719, 1781, 1750.61
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 61, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1911, sellCostBuyPrice =sellCostBuyPrice+1730
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1730, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1791
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1719, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1781
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1750.61
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1911, 1730, 1730
                    , 1791, 1719, 1781, 1750.61, 150, 61)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1911, netSellCostBuyPrice = netSellCostBuyPrice+1730
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1730
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1791
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1719
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1781
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1750.61
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+150
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+61;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 142572 and newid=143337 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:39:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:09:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:09:25', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143337');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:39:36";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:09:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 18:09:36', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:39:51";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:09:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 18:09:51', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =2868
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2868,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2868','76.00','76','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 18:09:52', '2', 'clientDeficitController.php', '', '76', '0', null, '0', null, null,'', '0','1','1','76','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '2868';
UPDATE client SET  inUse = 0 where clientid = 2868;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =2868 ,id=235980
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:39:52";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:09:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 18:09:52', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:39:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:09:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 18:09:54', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:40:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:10:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 18:10:37', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:40:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:10:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 18:10:49', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:41:12";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:11:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 18:11:12', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:41:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:11:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 18:11:43', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =5185
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5185,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5185','436.00','436','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 18:11:43', '2', 'clientDeficitController.php', '', '436', '0', null, '0', null, null,'', '0','1','1','436','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '5185';
UPDATE client SET  inUse = 0 where clientid = 5185;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =5185 ,id=235981
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:41:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:11:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:11:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:41:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:11:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 18:11:43', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:41:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:11:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 18:11:45', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:41:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:11:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:11:55', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:42:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:12:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:12:50', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a43bfa0b37
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 18:11:43', '0672a43bfa0b37', '1', '0.00', '0', '0', '1', '300', '300', '-300', '0', '1', '2024-11-05 18:12:51', '', '9', '0', 'نقدي','1', '0', '5', '26', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-300','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16236', '0', '2024-11-05 18:12:51', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:11:43','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('245.00', '06809', '16236', '5', '15493', '1', '300', '300', '0', '', '1', '0', '15493', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','300','300','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 244.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 244.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 188, lastbuyprice_withDiscountAndTax = 245
                where returnsellbilldetailid = 21276;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15493, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 300, 245, 245, 244
                    , 245, 244, 242.5, 0, 1, 0, 0, 245, 188)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+300, returnSellCostBuyPrice = returnSellCostBuyPrice+245, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+245
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+244, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+245
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+244
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+242.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+245
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+188
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 300, 245, 245, 244
                    , 245, 244, 242.5, 0, 0, 245, 188)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+300, returnSellCostBuyPrice = returnSellCostBuyPrice+245, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+245
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+244, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+245
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+244
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+242.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+245
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+188;
UPDATE storedetail SET  productquantity = '25', userid = '9', storedetaildate = '2024-11-05 18:12:51' WHERE storedetailid = '15492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15493', '1', '1', '0', '16236', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '24', '25', '9', '2024-11-05 18:12:51','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '59559',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('59859','-300', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16236', '59559', '2024-11-05 18:12:51', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 300, 245, 245, 244
                    , 245, 244, 242.5 ,0, 0, 245, 188)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+300, returnSellCostBuyPrice = returnSellCostBuyPrice+245, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+245
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+244, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+245
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+244
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+242.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+245
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+188;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 300, 245, 245, 244
                    , 245, 244, 242.5 ,0, 0, 245, 188)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+300, returnSellCostBuyPrice = returnSellCostBuyPrice+245, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+245
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+244, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+245
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+244
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+242.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+245
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+188;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -300, -245, -245
                    , -244, -245, -244, -242.5, -245, -188)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-300, netSellCostBuyPrice = netSellCostBuyPrice+-245
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-245
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-244
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-245
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-244
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-242.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-245
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-188;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a43bfa0b37 and sellbillId = 16236 and returnsellbillId = 16236
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:42:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:12:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:12:51', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:43:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:13:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:13:09', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a3bcfc0aa6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:37:51', '0672a3bcfc0aa6', '1', '0.00', '0', '0', '1', '350.00', '350', '350', '0', '1', '2024-11-05 18:13:09', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','350','0','','0','0','350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143338', '0', '2024-11-05 18:13:09', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '350', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 17:37:51','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34771;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06925', '143338', '5', '15785', '1', '350', '350', '0', '', '1', '2024-11-05 18:13:09', '15785', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34771-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 524023;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15785, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-05 18:13:09' WHERE storedetailid = '15784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15785', '1', '1', '1', '143338', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-05 18:13:09','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '59909',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('59559','350', '0', '1', 'اضافة فاتورة مبيعات', '143338', '59909', '2024-11-05 18:13:09', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 350, 280, 280
                    , 275, 280, 275, 270, 280, 270)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+350, netSellCostBuyPrice = netSellCostBuyPrice+280
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+280
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+275
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+280
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+275
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+270
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+280
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+270;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a3bcfc0aa6 and sellbillId = 143338 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:43:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:13:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:13:10', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE userid = 2;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:44:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:14:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 18:14:17', '75', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:44:18";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:44:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:14:23", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:14:23', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:45:50";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:15:50", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:15:50', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a402cc3887
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10287,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 17:56:28', '0672a402cc3887', '10287', '2015.00', '2217', '0', '1', '202.00', '202', '0', '202', '1', '2024-11-05 18:15:50', '', '75', '0', 'وفاء محمد 41', '2', '1', '3', '87', 'وفاء محمد 41', '2' ,'0','','','','','-1','0','0','0','0','0','202','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2217', userid = '75' WHERE clientid = '10287';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10287','2015.00','202','0','اضافة فاتورة مبيعات','143339', '2217', '2024-11-05 18:15:50', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '202', '0', null, '0', null, null,'', '0','1','1','202','1','2024-11-05 17:56:28','0','0');
UPDATE client SET  inUse = 0 where clientid = 10287;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34823;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06940', '143339', '5', '15821', '1', '200', '200', '0', '', '1', '2024-11-05 18:15:50', '15821', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34823-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 143, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 524024;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15821, '2024-11-05', 200, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '75', storedetaildate = '2024-11-05 18:15:50' WHERE storedetailid = '15820';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15821', '1', '1', '1', '143339', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '75', '2024-11-05 18:15:50','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143339', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-05 18:15:50', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 10287;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 202, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+202, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10287, '2024-11-05', 202, 140, 140
                    , 141, 140, 141, 142.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 143, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+202, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+142.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+143
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 202, 140, 140
                    , 141, 140, 141, 142.5, 140, 143)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+202, netSellCostBuyPrice = netSellCostBuyPrice+140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+141
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+141
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+142.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+143;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a402cc3887 and sellbillId = 143339 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:45:51";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:15:51", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:15:51', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:46:32";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:16:32", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:16:32', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a445fe6e10
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7700,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:14:23', '0672a445fe6e10', '7700', '0.00', '177', '0', '1', '177.00', '177', '0', '177', '1', '2024-11-05 18:16:32', '', '75', '0', 'دينا الفيوم K1008', '2', '1', '3', '79', 'دينا الفيوم K1008', '3' ,'0','','','','','-1','0','0','0','0','0','177','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '177', userid = '75' WHERE clientid = '7700';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7700','0.00','177','0','اضافة فاتورة مبيعات','143340', '177', '2024-11-05 18:16:32', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '177', '0', null, '0', null, null,'', '0','1','1','177','1','2024-11-05 18:14:23','0','0');
UPDATE client SET  inUse = 0 where clientid = 7700;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32745;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06389', '143340', '5', '14503', '1', '140', '140', '0', '', '1', '2024-11-05 18:16:32', '14503', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32745-1,','1','1','0','0','140','140','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 265.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 265.00
        
                where sellbilldetailid = 524026;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14503, '2024-11-05', 140, 155, 155
                    , 265, 155, 265, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 140, 155, 155
                    , 265, 155, 265, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-14', userid = '75', storedetaildate = '2024-11-05 18:16:32' WHERE storedetailid = '14502';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14503', '1', '1', '1', '143340', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-13', '-14', '75', '2024-11-05 18:16:32','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143340', '9', '2015', '1', '35', '35', '0', '', '1', '2024-11-05 18:16:32', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','35','35','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143340', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-05 18:16:32', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 7700;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 177, 155, 155
                    , 265, 155, 265, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+177, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7700, '2024-11-05', 177, 155, 155
                    , 265, 155, 265, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+177, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 177, 155, 155
                    , 265, 155, 265, 155, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+177, netSellCostBuyPrice = netSellCostBuyPrice+155
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+155
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+265
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+155
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+265
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+155
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a445fe6e10 and sellbillId = 143340 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:46:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:16:33", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:16:33', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:05";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:19:05", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:19:05', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a44b74a456
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8941,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:15:51', '0672a44b74a456', '8941', '27.00', '653', '0', '1', '626.00', '626', '0', '626', '1', '2024-11-05 18:19:05', '', '75', '0', 'احسان البلائسيZ530', '2', '1', '3', '98', 'احسان البلائسيZ530', '4' ,'0','','','','','-1','0','0','0','0','0','626','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '653', userid = '75' WHERE clientid = '8941';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8941','27.00','626','0','اضافة فاتورة مبيعات','143341', '653', '2024-11-05 18:19:05', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '626', '0', null, '0', null, null,'', '0','1','1','626','1','2024-11-05 18:15:51','0','0');
UPDATE client SET  inUse = 0 where clientid = 8941;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34660;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','R3249', '143341', '1', '15731', '2', '300', '600', '0', '', '1', '2024-11-05 18:19:05', '15731', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34660-2,','1','1','0','0','300','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 524029;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15731, '2024-11-05', 600, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 600, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 18:19:05' WHERE storedetailid = '15730';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15731', '1', '2', '1', '143341', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '12', '75', '2024-11-05 18:19:05','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143341', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:19:05', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143341', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-05 18:19:05', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 8941;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 626, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+626, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8941, '2024-11-05', 626, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+626, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 626, 490, 490
                    , 490, 490, 490, 490, 490, 490)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+626, netSellCostBuyPrice = netSellCostBuyPrice+490
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+490
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+490
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+490
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+490
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+490
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+490
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+490;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a44b74a456 and sellbillId = 143341 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:06";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:19:06", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:19:06', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:19:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:19:12', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:19:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:19:32', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','2', '3564', '2024-11-05', '9', '0', '0','','1','1','0','0','3564');
UPDATE save SET  savecurrentvalue = '56345',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('59909.00','3564', '1', '1', 'تحويل امول الى الخزنة  [ فودافون كاش ] ', '3308', '56345', '2024-11-05 18:19:33', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '215604.5',  userid = '9' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('212040.50','3564', '0', '2', 'تحويل امول من الخزنة  [ نقدي ] ', '3308', '215604.5', '2024-11-05 18:19:33', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '2', transfermoneyvalue = '3564.00', transfermoneydate = '2024-11-05', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='3564' WHERE transfermoneyid = '3308';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:19:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:19:33', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:19:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:19:35', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:19:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:19:36', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:19:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 18:19:38', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:49:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:19:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 18:19:45', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:51:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:21:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 18:21:51', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:51:55";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:21:55", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:21:55', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a457a9e347
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7733,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:19:06', '0672a457a9e347', '7733', '1.00', '648', '0', '1', '647.00', '647', '0', '647', '1', '2024-11-05 18:21:56', '', '75', '0', 'اماني مصطفي I966', '2', '1', '3', '87', 'اماني مصطفي I966', '3' ,'0','','','','','-1','0','0','0','0','0','647','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '648', userid = '75' WHERE clientid = '7733';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7733','1.00','647','0','اضافة فاتورة مبيعات','143342', '648', '2024-11-05 18:21:56', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '647', '0', null, '0', null, null,'', '0','1','1','647','1','2024-11-05 18:19:06','0','0');
UPDATE client SET  inUse = 0 where clientid = 7733;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34200;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('500','H1358', '143342', '14', '15474', '1', '620', '620', '0', '', '1', '2024-11-05 18:21:56', '15474', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34200-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 326, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 524032;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15474, '2024-11-05', 620, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 500, 326, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+326
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 620, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 326, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+326
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-05 18:21:56' WHERE storedetailid = '15473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15474', '1', '1', '1', '143342', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-05 18:21:56','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143342', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:21:56', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143342', '17', '10291', '1', '7', '7', '0', '', '1', '2024-11-05 18:21:56', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','7','7','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 7733;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 647, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,500, 326, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+647, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+326
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7733, '2024-11-05', 647, 500, 500
                    , 500, 500, 500, 500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,500, 326, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+647, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+326
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 647, 500, 500
                    , 500, 500, 500, 500, 500, 326)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+647, netSellCostBuyPrice = netSellCostBuyPrice+500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+500
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+500
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+500
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+500
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+500
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+326;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a457a9e347 and sellbillId = 143342 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:51:56";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:21:56", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:21:56', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 18:22:02', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '5', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '56340',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('56345.00','5', '1', '1', 'إضافة مصروف', '24291', '56340', '2024-11-05 18:22:02', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '5.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24291';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 18:22:03', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 18:22:04', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 18:22:05', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 18:22:18', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'مرتجع', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '56290',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('56340.00','50', '1', '1', 'إضافة مصروف', '24292', '56290', '2024-11-05 18:22:18', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'مرتجع', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24292';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 18:22:19', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 18:22:20', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:22:36', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:22:44', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','8', '10000', '2024-11-05', '9', '0', '0','','1','1','0','0','10000');
UPDATE save SET  savecurrentvalue = '46290',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('56290.00','10000', '1', '1', 'تحويل امول الى الخزنة  [ شيكات وكمبيالات ] ', '3309', '46290', '2024-11-05 18:22:44', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '415000',  userid = '9' WHERE saveid = '8';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('405000.00','10000', '0', '8', 'تحويل امول من الخزنة  [ نقدي ] ', '3309', '415000', '2024-11-05 18:22:44', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '8', transfermoneyvalue = '10000.00', transfermoneydate = '2024-11-05', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='10000' WHERE transfermoneyid = '3309';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:22:44', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:22:46', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:22:48', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:22:56', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('1','5', '5000', '2024-11-05', '9', '0', '0','','1','1','0','0','5000');
UPDATE save SET  savecurrentvalue = '41290',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46290.00','5000', '1', '1', 'تحويل امول الى الخزنة  [ جمعيه ] ', '3310', '41290', '2024-11-05 18:22:56', '9',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '50000',  userid = '9' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('45000.00','5000', '0', '5', 'تحويل امول من الخزنة  [ نقدي ] ', '3310', '50000', '2024-11-05 18:22:56', '9',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '1', saveidto = '5', transfermoneyvalue = '5000.00', transfermoneydate = '2024-11-05', userid = '9', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='5000' WHERE transfermoneyid = '3310';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:22:57', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:52:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:22:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 18:22:59', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:55:10";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:25:11", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 18:25:11', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13627&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:55:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:25:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:25:13', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:55:19";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:25:19", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:25:19', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13626');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:58:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:28:24", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:28:24', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a44e158c76
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7053,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:16:33', '0672a44e158c76', '7053', '-146.00', '1743', '0', '1', '1889.00', '1889', '0', '1889', '1', '2024-11-05 18:28:24', '', '75', '0', 'وسام سعيد k15', '2', '1', '3', '79', 'وسام سعيد k15', '8' ,'0','','','','','-1','0','0','0','0','0','1889','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1743', userid = '75' WHERE clientid = '7053';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7053','-146.00','1889','0','اضافة فاتورة مبيعات','143343', '1743', '2024-11-05 18:28:24', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1889', '0', null, '0', null, null,'', '0','1','1','1889','1','2024-11-05 18:16:33','0','0');
UPDATE client SET  inUse = 0 where clientid = 7053;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34283;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','06815', '143343', '5', '15500', '1', '500', '500', '0', '', '1', '2024-11-05 18:28:24', '15500', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34283-1,','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        
                where sellbilldetailid = 524035;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15500, '2024-11-05', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 500, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 18:28:24' WHERE storedetailid = '15499';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15500', '1', '1', '1', '143343', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '75', '2024-11-05 18:28:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34709;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('110','R3241', '143343', '1', '15581', '2', '165', '330', '0', '', '1', '2024-11-05 18:28:24', '15581', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34709-2,','1','1','0','0','165','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 110.00 , meanbuyprice = 112.00, lastbuyprice_withDiscount = 110.00, meanbuyprice_withDiscount = 112.00
        , lastbuyprice_withTax = 110, meanbuyprice_withTax = 77, lastbuyprice_withDiscountAndTax = 110
                where sellbilldetailid = 524036;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15581, '2024-11-05', 330, 220, 220
                    , 224, 220, 224, 226.66
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 220, 154, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+224
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+224
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+226.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+154
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 220, 220
                    , 224, 220, 224, 226.66
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 154, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+224
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+224
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+226.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+154
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '75', storedetaildate = '2024-11-05 18:28:24' WHERE storedetailid = '15580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15581', '1', '2', '1', '143343', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '21', '75', '2024-11-05 18:28:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34423;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('485','R3225', '143343', '1', '15517', '1', '570', '570', '0', '', '1', '2024-11-05 18:28:24', '15517', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34423-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        
                where sellbilldetailid = 524037;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15517, '2024-11-05', 570, 485, 485
                    , 485, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 485, 485
                    , 485, 485, 485, 485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 18:28:24' WHERE storedetailid = '15516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15517', '1', '1', '1', '143343', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 18:28:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33478;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','R3111', '143343', '1', '15027', '1', '250', '250', '0', '', '1', '2024-11-05 18:28:24', '15027', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33478-1,','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        
                where sellbilldetailid = 524038;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15027, '2024-11-05', 250, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 250, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 18:28:24' WHERE storedetailid = '15026';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15027', '1', '1', '1', '143343', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-05 18:28:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34616;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06811', '143343', '5', '15497', '1', '200', '200', '0', '', '1', '2024-11-05 18:28:24', '15497', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34616-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 524039;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15497, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 18:28:24' WHERE storedetailid = '15496';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15497', '1', '1', '1', '143343', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 18:28:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143343', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:28:24', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143343', '17', '10291', '1', '19', '19', '0', '', '1', '2024-11-05 18:28:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','19','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 7053;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1889, 1495, 1495
                    , 1499, 1495, 1499, 1501.66
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,370, 269, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1889, sellCostBuyPrice =sellCostBuyPrice+1495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1499
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1499
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1501.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+269
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7053, '2024-11-05', 1889, 1495, 1495
                    , 1499, 1495, 1499, 1501.66
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,370, 269, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1889, sellCostBuyPrice =sellCostBuyPrice+1495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1499
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1499
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1501.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+269
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1889, 1495, 1495
                    , 1499, 1495, 1499, 1501.66, 370, 269)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1889, netSellCostBuyPrice = netSellCostBuyPrice+1495
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1495
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1499
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1495
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1499
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1501.66
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+370
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+269;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a44e158c76 and sellbillId = 143343 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:58:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:28:25", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:28:25', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:58:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:28:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:28:49', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:59:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:29:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:29:17', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a47c173315
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:28:49', '0672a47c173315', '1', '0.00', '0', '0', '1', '650.00', '650', '650', '0', '1', '2024-11-05 18:29:17', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','650','0','','0','0','650','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143344', '0', '2024-11-05 18:29:17', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '650', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:28:49','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 35019;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('595','H1400', '143344', '14', '15652', '1', '650', '650', '0', '', '1', '2024-11-05 18:29:17', '15652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','35019-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 595.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 595.00
        , lastbuyprice_withTax = 595, meanbuyprice_withTax = 595, lastbuyprice_withDiscountAndTax = 595
                where sellbilldetailid = 524042;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15652, '2024-11-05', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0, 595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 18:29:17' WHERE storedetailid = '15651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15652', '1', '1', '1', '143344', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 18:29:17','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '41940',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('41290','650', '0', '1', 'اضافة فاتورة مبيعات', '143344', '41940', '2024-11-05 18:29:17', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 650, 595, 595
                    , 595, 595, 595, 595
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,595, 595, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+650, sellCostBuyPrice =sellCostBuyPrice+595
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+595, sellCostMeanBuyPrice = sellCostMeanBuyPrice+595
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+595
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+595
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+595
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+595
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 650, 595, 595
                    , 595, 595, 595, 595, 595, 595)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+650, netSellCostBuyPrice = netSellCostBuyPrice+595
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+595
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+595
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+595
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+595
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+595
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+595
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+595;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a47c173315 and sellbillId = 143344 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 14:59:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:29:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:29:18', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:00:48";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:30:48", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:30:48', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a46251f63e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9783,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:21:57', '0672a46251f63e', '9783', '0.00', '1914', '0', '1', '1914.00', '1914', '0', '1914', '1', '2024-11-05 18:30:48', '', '75', '0', 'حسناء محمود 41', '2', '1', '3', '87', 'حسناء محمود 41', '6' ,'0','','','','','-1','0','0','0','0','0','1914','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1914', userid = '75' WHERE clientid = '9783';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9783','0.00','1914','0','اضافة فاتورة مبيعات','143345', '1914', '2024-11-05 18:30:48', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1914', '0', null, '0', null, null,'', '0','1','1','1914','1','2024-11-05 18:21:57','0','0');
UPDATE client SET  inUse = 0 where clientid = 9783;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34444;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1376', '143345', '14', '15583', '1', '465', '465', '0', '', '1', '2024-11-05 18:30:48', '15583', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34444-1,','1','1','0','0','465','465','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 524043;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15583, '2024-11-05', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 465, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 18:30:48' WHERE storedetailid = '15582';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15583', '1', '1', '1', '143345', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 18:30:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 22048;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','H1173', '143345', '14', '10065', '2', '420', '840', '0', '', '1', '2024-11-05 18:30:48', '10065', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','22048-2,','1','1','0','0','420','840','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 524044;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10065, '2024-11-05', 840, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 840, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 18:30:48' WHERE storedetailid = '10064';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10065', '1', '2', '1', '143345', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '3', '75', '2024-11-05 18:30:48','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34664;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1409', '143345', '14', '15689', '1', '570', '570', '0', '', '1', '2024-11-05 18:30:48', '15689', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34664-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 524045;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15689, '2024-11-05', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '75', storedetaildate = '2024-11-05 18:30:48' WHERE storedetailid = '15688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15689', '1', '1', '1', '143345', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '27', '75', '2024-11-05 18:30:48','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143345', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:30:48', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143345', '17', '10291', '1', '19', '19', '0', '', '1', '2024-11-05 18:30:48', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','19','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 9783;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1914, 1470, 1470
                    , 1470, 1470, 1470, 1470
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,870, 680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1914, sellCostBuyPrice =sellCostBuyPrice+1470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1470
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+870
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9783, '2024-11-05', 1914, 1470, 1470
                    , 1470, 1470, 1470, 1470
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,870, 680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1914, sellCostBuyPrice =sellCostBuyPrice+1470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1470
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+870
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1914, 1470, 1470
                    , 1470, 1470, 1470, 1470, 870, 680)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1914, netSellCostBuyPrice = netSellCostBuyPrice+1470
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1470
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1470
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1470
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1470
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1470
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+870
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+680;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a46251f63e and sellbillId = 143345 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:00:49";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:30:49", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:30:49', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:01:19";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:31:19", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 18:31:19', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=2219');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:01:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:31:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:31:21', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a47de6e2d8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:29:18', '0672a47de6e2d8', '1', '0.00', '0', '0', '1', '430.00', '430', '430', '0', '1', '2024-11-05 18:31:21', '', '9', '0', 'نقدي', '1', '0', '3', '71', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','430','0','','0','0','430','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143346', '0', '2024-11-05 18:31:21', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '430', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34869;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','H1455', '143346', '14', '15838', '1', '430', '430', '0', '', '1', '2024-11-05 18:31:21', '15838', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34869-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 524048;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15838, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '9', storedetaildate = '2024-11-05 18:31:21' WHERE storedetailid = '15837';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15838', '1', '1', '1', '143346', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '9', '2024-11-05 18:31:21','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42370',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('41940','430', '0', '1', 'اضافة فاتورة مبيعات', '143346', '42370', '2024-11-05 18:31:21', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 71 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 430, 350, 350
                    , 350, 350, 350, 350, 350, 350)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+430, netSellCostBuyPrice = netSellCostBuyPrice+350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a47de6e2d8 and sellbillId = 143346 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:01:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:31:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:31:22', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:04:30";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:34:30", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:34:30', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:04:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:34:42", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:34:42', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a47a950eeb
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9525,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:28:25', '0672a47a950eeb', '9525', '0.00', '626', '0', '1', '626.00', '626', '0', '626', '1', '2024-11-05 18:34:42', '', '75', '0', 'حسناء k658', '2', '1', '3', '79', 'حسناء k658', '4' ,'0','','','','','-1','0','0','0','0','0','626','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '626', userid = '75' WHERE clientid = '9525';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9525','0.00','626','0','اضافة فاتورة مبيعات','143347', '626', '2024-11-05 18:34:42', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '626', '0', null, '0', null, null,'', '0','1','1','626','1','2024-11-05 18:28:25','0','0');
UPDATE client SET  inUse = 0 where clientid = 9525;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 33792;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06440', '143347', '5', '14652', '2', '300', '600', '0', '', '1', '2024-11-05 18:34:42', '14652', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33792-2,','1','1','0','0','300','600','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 524049;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14652, '2024-11-05', 600, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 600, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 18:34:42' WHERE storedetailid = '14651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14652', '1', '2', '1', '143347', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '4', '75', '2024-11-05 18:34:42','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143347', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:34:42', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143347', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-05 18:34:42', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 79 where clientid = 9525;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 626, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+626, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9525, '2024-11-05', 626, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+626, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 626, 480, 480
                    , 480, 480, 480, 480, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+626, netSellCostBuyPrice = netSellCostBuyPrice+480
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+480
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+480
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+480
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+480
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+480
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a47a950eeb and sellbillId = 143347 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:04:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:34:43", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:34:43', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:05:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:35:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:35:20', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:05:29";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:35:29", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:35:29', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:05:50";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:35:50", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 18:35:50', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=2310');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:05:52";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:35:52", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 18:35:52', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=2303');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:06:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:36:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:36:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4948dbb47
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno) VALUES ('2024-11-05 18:35:20', '0672a4948dbb47', '1', '0.00', '0', '0', '1', '440', '440', '-440', '0', '1', '2024-11-05 18:36:08', '', '9', '0', 'نقدي','1', '0', '5', '92', 'نقدي', '2', '0', '', '','','','-1','0','0','0','','0','-440','0','0','0','0','0','0','0','0','-1','0','1','1','');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','16237', '0', '2024-11-05 18:36:08', '9', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '440', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:35:20','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('190.00', '06877', '16237', '5', '15668', '1', '240', '240', '0', '', '1', '0', '15668', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','240','240','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where returnsellbilldetailid = 21277;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15668, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 240, 190, 190, 190
                    , 190, 190, 190, 0, 1, 0, 0, 190, 190)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+240, returnSellCostBuyPrice = returnSellCostBuyPrice+190, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+190
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+190, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+190
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+190
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+190
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+190
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+190
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 240, 190, 190, 190
                    , 190, 190, 190, 0, 0, 190, 190)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+240, returnSellCostBuyPrice = returnSellCostBuyPrice+190, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+190
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+190, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+190
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+190
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+190
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+190
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+190;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 18:36:08' WHERE storedetailid = '15667';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15668', '1', '1', '0', '16237', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '6', '7', '9', '2024-11-05 18:36:08','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('150.00', '06786', '16237', '5', '15389', '1', '200', '200', '0', '', '1', '0', '15389', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','200','200','0','','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 149.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 149.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 122, lastbuyprice_withDiscountAndTax = 150
                where returnsellbilldetailid = 21278;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15389, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 200, 150, 150, 149
                    , 150, 149, 146.67, 0, 1, 0, 0, 150, 122)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+200, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+149, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+149
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+146.67
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+122
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 200, 150, 150, 149
                    , 150, 149, 146.67, 0, 0, 150, 122)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+200, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+149, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+149
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+146.67
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+122;
UPDATE storedetail SET  productquantity = '17', userid = '9', storedetaildate = '2024-11-05 18:36:08' WHERE storedetailid = '15388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15389', '1', '1', '0', '16237', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '16', '17', '9', '2024-11-05 18:36:08','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '41930',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42370','-440', '1', '1', 'اضافة فاتورة مردوات مبيعات', '16237', '41930', '2024-11-05 18:36:08', '9',  'returnsellbillController.php','1','','0');
UPDATE client SET  delegateid = 92 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 440, 340, 340, 339
                    , 340, 339, 336.67 ,0, 0, 340, 312)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+440, returnSellCostBuyPrice = returnSellCostBuyPrice+340, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+340
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+339, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+340
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+339
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+336.67
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+340
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+312;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 440, 340, 340, 339
                    , 340, 339, 336.67 ,0, 0, 340, 312)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+440, returnSellCostBuyPrice = returnSellCostBuyPrice+340, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+340
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+339, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+340
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+339
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+336.67
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+340
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+312;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -440, -340, -340
                    , -339, -340, -339, -336.67, -340, -312)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-440, netSellCostBuyPrice = netSellCostBuyPrice+-340
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-340
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-339
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-340
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-339
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-336.67
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-340
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-312;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4948dbb47 and sellbillId = 16237 and returnsellbillId = 16237
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:06:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:36:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:36:08', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:07:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:37:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:37:30', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a485a5d991
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:31:22', '0672a485a5d991', '1', '0.00', '0', '0', '1', '665.00', '665', '665', '0', '1', '2024-11-05 18:37:30', '', '9', '0', 'نقدي', '1', '0', '3', '92', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','665','0','','0','0','665','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143348', '0', '2024-11-05 18:37:30', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '665', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:31:22','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34732;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06915', '143348', '5', '15765', '1', '200', '200', '0', '', '1', '2024-11-05 18:37:30', '15765', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34732-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 150, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 524052;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15765, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 18:37:30' WHERE storedetailid = '15764';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15765', '1', '1', '1', '143348', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 18:37:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27552;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','05625', '143348', '5', '12279', '1', '275', '275', '0', '', '1', '2024-11-05 18:37:30', '12279', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27552-1,','1','1','0','0','275','275','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 1383.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 1383.00
        
                where sellbilldetailid = 524053;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12279, '2024-11-05', 275, 440, 440
                    , 1383, 440, 1383, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1383
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1383
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 275, 440, 440
                    , 1383, 440, 1383, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1383
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1383
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 18:37:30' WHERE storedetailid = '12278';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12279', '1', '1', '1', '143348', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 18:37:30','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 23724;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('480','53925', '143348', '5', '10889', '1', '190', '190', '0', '', '1', '2024-11-05 18:37:30', '10889', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','23724-1,','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 1080.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 1080.00
        
                where sellbilldetailid = 524054;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10889, '2024-11-05', 190, 480, 480
                    , 1080, 480, 1080, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 480, 480
                    , 1080, 480, 1080, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 18:37:30' WHERE storedetailid = '10888';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10889', '1', '1', '1', '143348', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 18:37:30','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42595',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('41930','665', '0', '1', 'اضافة فاتورة مبيعات', '143348', '42595', '2024-11-05 18:37:30', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 92 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 665, 1070, 1070
                    , 2613, 1070, 2613, 1070
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+665, sellCostBuyPrice =sellCostBuyPrice+1070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2613
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2613
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 665, 1070, 1070
                    , 2613, 1070, 2613, 1070
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+665, sellCostBuyPrice =sellCostBuyPrice+1070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2613
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2613
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 665, 1070, 1070
                    , 2613, 1070, 2613, 1070, 150, 150)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+665, netSellCostBuyPrice = netSellCostBuyPrice+1070
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1070
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2613
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1070
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2613
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1070
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+150
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+150;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a485a5d991 and sellbillId = 143348 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:07:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:37:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:37:31', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:09:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:39:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:39:02', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a49cbb7edc
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:37:31', '0672a49cbb7edc', '1', '0.00', '0', '0', '1', '380.00', '380', '380', '0', '1', '2024-11-05 18:39:02', '', '9', '0', 'نقدي', '1', '0', '3', '6', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','380','0','','0','0','380','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143349', '0', '2024-11-05 18:39:02', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '380', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:37:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34221;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06712', '143349', '5', '15227', '1', '380', '380', '0', '', '1', '2024-11-05 18:39:03', '15227', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34221-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 960, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 524055;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15227, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '9', storedetaildate = '2024-11-05 18:39:03' WHERE storedetailid = '15226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15227', '1', '1', '1', '143349', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '9', '2024-11-05 18:39:03','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42975',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42595','380', '0', '1', 'اضافة فاتورة مبيعات', '143349', '42975', '2024-11-05 18:39:03', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 6 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 380, 320, 320
                    , 320, 320, 320, 320, 320, 960)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+380, netSellCostBuyPrice = netSellCostBuyPrice+320
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+320
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+320
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+320
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+320
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+320
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+320
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+960;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a49cbb7edc and sellbillId = 143349 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:09:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:39:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:39:03', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:09:06";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:39:06", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 18:39:06', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:09:32";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:39:32", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:39:32', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a48398936d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10285,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:30:49', '0672a48398936d', '10285', '3247.00', '4136', '0', '1', '889.00', '889', '0', '889', '1', '2024-11-05 18:39:32', '', '75', '0', 'ميرهان خيري 56', '2', '1', '3', '86', 'ميرهان خيري 56', '4' ,'0','','','','','-1','0','0','0','0','0','889','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '4136', userid = '75' WHERE clientid = '10285';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10285','3247.00','889','0','اضافة فاتورة مبيعات','143350', '4136', '2024-11-05 18:39:32', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '889', '0', null, '0', null, null,'', '0','1','1','889','1','2024-11-05 18:30:49','0','0');
UPDATE client SET  inUse = 0 where clientid = 10285;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30282;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05979', '143350', '5', '13344', '1', '470', '470', '0', '', '1', '2024-11-05 18:39:32', '13344', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30282-1,','1','1','0','0','470','470','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 524056;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13344, '2024-11-05', 470, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 470, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+470, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 18:39:32' WHERE storedetailid = '13343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13344', '1', '1', '1', '143350', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 18:39:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31813;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','00D49', '143350', '1', '14299', '1', '200', '200', '0', '', '1', '2024-11-05 18:39:32', '14299', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31813-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        
                where sellbilldetailid = 524057;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14299, '2024-11-05', 200, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 18:39:32' WHERE storedetailid = '14298';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14299', '1', '1', '1', '143350', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 18:39:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31204;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','00D43', '143350', '1', '13621', '1', '210', '210', '0', '', '1', '2024-11-05 18:39:33', '13621', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31204-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        
                where sellbilldetailid = 524058;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13621, '2024-11-05', 210, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 18:39:33' WHERE storedetailid = '13620';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13621', '1', '1', '1', '143350', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 18:39:33','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143350', '17', '10291', '1', '9', '9', '0', '', '1', '2024-11-05 18:39:33', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','9','9','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 86 where clientid = 10285;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 889, 885, 885
                    , 885, 885, 885, 885
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+889, sellCostBuyPrice =sellCostBuyPrice+885
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+885, sellCostMeanBuyPrice = sellCostMeanBuyPrice+885
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+885, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+885
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+885
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10285, '2024-11-05', 889, 885, 885
                    , 885, 885, 885, 885
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+889, sellCostBuyPrice =sellCostBuyPrice+885
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+885, sellCostMeanBuyPrice = sellCostMeanBuyPrice+885
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+885, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+885
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+885
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 889, 885, 885
                    , 885, 885, 885, 885, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+889, netSellCostBuyPrice = netSellCostBuyPrice+885
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+885
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+885
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+885
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+885
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+885
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a48398936d and sellbillId = 143350 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:09:33";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:39:33", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:39:33', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:11:20";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:41:20", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:41:20', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4a45daa41
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6414,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:39:33', '0672a4a45daa41', '6414', '2156.00', '2767', '0', '1', '611.00', '611', '0', '611', '1', '2024-11-05 18:41:20', '', '75', '0', 'ياسمين ابو السيالة u98', '2', '1', '3', '91', 'ياسمين ابو السيالة u98', '3' ,'0','','','','','-1','0','0','0','0','0','611','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '2767', userid = '75' WHERE clientid = '6414';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6414','2156.00','611','0','اضافة فاتورة مبيعات','143351', '2767', '2024-11-05 18:41:20', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '611', '0', null, '0', null, null,'', '0','1','1','611','1','2024-11-05 18:39:33','0','0');
UPDATE client SET  inUse = 0 where clientid = 6414;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34457;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1390', '143351', '14', '15590', '1', '585', '585', '0', '', '1', '2024-11-05 18:41:20', '15590', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34457-1,','1','1','0','0','585','585','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 465.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 461, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 524060;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15590, '2024-11-05', 585, 450, 450
                    , 465, 450, 465, 457.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 461, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+585, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+457.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+461
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 585, 450, 450
                    , 465, 450, 465, 457.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 461, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+585, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+457.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+461
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '75', storedetaildate = '2024-11-05 18:41:20' WHERE storedetailid = '15589';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15590', '1', '1', '1', '143351', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '75', '2024-11-05 18:41:20','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143351', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:41:20', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143351', '17', '10291', '1', '6', '6', '0', '', '1', '2024-11-05 18:41:20', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6','6','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 91 where clientid = 6414;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 611, 450, 450
                    , 465, 450, 465, 457.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,450, 461, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+611, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+457.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+461
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6414, '2024-11-05', 611, 450, 450
                    , 465, 450, 465, 457.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,450, 461, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+611, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+457.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+461
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 611, 450, 450
                    , 465, 450, 465, 457.5, 450, 461)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+611, netSellCostBuyPrice = netSellCostBuyPrice+450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+465
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+465
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+457.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+450
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+461;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4a45daa41 and sellbillId = 143351 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:11:21";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:41:21", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:41:21', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:12:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:42:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:42:04', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:12:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:42:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:42:17', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a49236f7fa
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1221,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:34:43', '0672a49236f7fa', '1221', '10.00', '763', '0', '1', '753.00', '753', '0', '753', '1', '2024-11-05 18:42:17', '', '75', '0', 'نور عبد الله 14', '2', '1', '3', '82', 'نور عبد الله 14', '4' ,'0','','','','','-1','0','0','0','0','0','753','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '763', userid = '75' WHERE clientid = '1221';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1221','10.00','753','0','اضافة فاتورة مبيعات','143352', '763', '2024-11-05 18:42:17', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '753', '0', null, '0', null, null,'', '0','1','1','753','1','2024-11-05 18:34:43','0','0');
UPDATE client SET  inUse = 0 where clientid = 1221;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34821;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','06944', '143352', '5', '15819', '1', '480', '480', '0', '', '1', '2024-11-05 18:42:17', '15819', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34821-1,','1','1','0','0','480','480','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 524063;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15819, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 480, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '75', storedetaildate = '2024-11-05 18:42:17' WHERE storedetailid = '15818';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15819', '1', '1', '1', '143352', 'اضافة فاتورة مبيعات', 'sellbillController.php', '58', '57', '75', '2024-11-05 18:42:17','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27466;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('355','05323', '143352', '5', '11629', '1', '245', '245', '0', '', '1', '2024-11-05 18:42:17', '11629', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27466-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 355.00 , meanbuyprice = 349.00, lastbuyprice_withDiscount = 355.00, meanbuyprice_withDiscount = 349.00
        
                where sellbilldetailid = 524064;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11629, '2024-11-05', 245, 355, 355
                    , 349, 355, 349, 343.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+355, sellCostMeanBuyPrice = sellCostMeanBuyPrice+349
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+355, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+349
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+343.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 245, 355, 355
                    , 349, 355, 349, 343.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+355
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+355, sellCostMeanBuyPrice = sellCostMeanBuyPrice+349
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+355, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+349
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+343.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 18:42:17' WHERE storedetailid = '11628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11629', '1', '1', '1', '143352', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 18:42:17','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143352', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:42:17', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143352', '17', '10291', '1', '8', '8', '0', '', '1', '2024-11-05 18:42:17', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 82 where clientid = 1221;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 753, 775, 775
                    , 769, 775, 769, 763.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+753, sellCostBuyPrice =sellCostBuyPrice+775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+769
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+769
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+763.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1221, '2024-11-05', 753, 775, 775
                    , 769, 775, 769, 763.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+753, sellCostBuyPrice =sellCostBuyPrice+775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+769
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+769
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+763.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 753, 775, 775
                    , 769, 775, 769, 763.75, 420, 420)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+753, netSellCostBuyPrice = netSellCostBuyPrice+775
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+775
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+769
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+775
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+769
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+763.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+420
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+420;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a49236f7fa and sellbillId = 143352 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:12:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:42:18", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:42:18', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:12:58";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:42:58", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:42:58', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13617');
UPDATE user SET loginip = "" WHERE userid = 2;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:13:05";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:43:05", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:43:05', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:13:17";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:43:17", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:43:17', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:13:21";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:43:21", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:43:21', '77', 'editbill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editbill&id=13616');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6952','','5','230','280', '280','280', '2024-11-05', '0', '77', '1', '06952', '0', '0', '0', '0', '0', '230','230','230','230','230','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','230','230','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15878, 1,'2024-11-05 18:43:40',77)
                ON DUPLICATE KEY UPDATE productid = 15878, edited = 1, sysdate = '2024-11-05 18:43:40', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15878', '1', '2024-11-05', '77', '0','1587801','280','280','280','230','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15878', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15878', '1', '0', '0', '15878', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:13:41";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:43:41", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 18:43:41', '77', 'showbarcode', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcode');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:14:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:44:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:44:09', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4a281616b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:39:04', '0672a4a281616b', '1', '0.00', '0', '0', '1', '385.00', '385', '385', '0', '1', '2024-11-05 18:44:09', '', '9', '0', 'نقدي', '1', '0', '3', '54', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','385','0','','0','0','385','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143353', '0', '2024-11-05 18:44:09', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '385', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:39:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34816;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','R3276', '143353', '1', '15814', '1', '385', '385', '0', '', '1', '2024-11-05 18:44:09', '15814', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34816-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 524067;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15814, '2024-11-05', 385, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '9', storedetaildate = '2024-11-05 18:44:09' WHERE storedetailid = '15813';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15814', '1', '1', '1', '143353', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '9', '2024-11-05 18:44:09','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '43360',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42975','385', '0', '1', 'اضافة فاتورة مبيعات', '143353', '43360', '2024-11-05 18:44:09', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 54 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 385, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 385, 320, 320
                    , 320, 320, 320, 320, 320, 320)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+385, netSellCostBuyPrice = netSellCostBuyPrice+320
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+320
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+320
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+320
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+320
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+320
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+320
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+320;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4a281616b and sellbillId = 143353 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:14:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:44:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:44:10', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:15:16";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:45:16", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:45:16', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4ab14a1fe
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2722,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:41:21', '0672a4ab14a1fe', '2722', '374.00', '677', '0', '1', '303.00', '303', '0', '303', '1', '2024-11-05 18:45:16', '', '75', '0', 'ريم الباهي w341', '2', '1', '3', '83', 'ريم الباهي w341', '2' ,'0','','','','','-1','0','0','0','0','0','303','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '677', userid = '75' WHERE clientid = '2722';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2722','374.00','303','0','اضافة فاتورة مبيعات','143354', '677', '2024-11-05 18:45:16', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '303', '0', null, '0', null, null,'', '0','1','1','303','1','2024-11-05 18:41:21','0','0');
UPDATE client SET  inUse = 0 where clientid = 2722;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34881;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','0K794', '143354', '7', '15843', '1', '300', '300', '0', '', '1', '2024-11-05 18:45:16', '15843', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34881-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 524068;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15843, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '75', storedetaildate = '2024-11-05 18:45:16' WHERE storedetailid = '15842';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15843', '1', '1', '1', '143354', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '75', '2024-11-05 18:45:16','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143354', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 18:45:16', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 83 where clientid = 2722;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 303, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2722, '2024-11-05', 303, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+303, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 303, 240, 240
                    , 240, 240, 240, 240, 240, 240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+303, netSellCostBuyPrice = netSellCostBuyPrice+240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4ab14a1fe and sellbillId = 143354 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:15:17";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 18:45:17", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:45:17', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:16:22";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:46:22", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 18:46:22', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:16:34";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:46:34", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 18:46:34', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:16:37";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:46:37", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:46:37', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13567');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:16:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:46:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:46:50', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:47:13', '77', 'update', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=update');
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 13616;
UPDATE buybill SET  buybillsysdate = '2024-11-05 18:47:13', userid = '77',delbyuserid = '77', conditions = '1' WHERE buybillid = '13616';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15806, 0, 0
                    , 155, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET productName = '6931', productDescription = '', productCatId = '5', productBuyPrice = '155.00', productSellAllPrice = '210.00', productSellUnitPrice = '210.00', productSellHalfPrice = '210.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06931',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '155',lastbuyprice_withDiscount = '155',meanbuyprice = '155',meanbuyprice_withDiscount = '155' , productbuypricereal = '155.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='155',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='155',meanbuyprice_withTax='155',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15806';
UPDATE productunit SET proUnitBuyPrice  = 155 * productnumber WHERE productid = 15806;
UPDATE storedetail SET  productquantity = '14', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15805';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15806', '1', '15', '1', '13616', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '29', '14', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15664, 0, 0
                    , 145, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET productName = '6891', productDescription = '', productCatId = '5', productBuyPrice = '145.00', productSellAllPrice = '210.00', productSellUnitPrice = '210.00', productSellHalfPrice = '210.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '06891',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '145',lastbuyprice_withDiscount = '145',meanbuyprice = '145',meanbuyprice_withDiscount = '145' , productbuypricereal = '145.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='145',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='145',meanbuyprice_withTax='145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15664';
UPDATE productunit SET proUnitBuyPrice  = 145 * productnumber WHERE productid = 15664;
UPDATE storedetail SET  productquantity = '26', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15664', '1', '15', '1', '13616', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '41', '26', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15860, 0, 0
                    , 270, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE buybilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270.00, meanbuyprice_withTax = 270.00, lastbuyprice_withDiscountAndTax = 270.00
                where buybilldetailid = 31344;
UPDATE product SET productName = '6953', productDescription = '', productCatId = '5', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270',lastbuyprice_withDiscount = '0',meanbuyprice = '270.00',meanbuyprice_withDiscount = '270' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15860';
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 15860;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15859';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15860', '1', '15', '1', '13616', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15861, 0, 0
                    , 250, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE buybilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250.00, meanbuyprice_withTax = 250.00, lastbuyprice_withDiscountAndTax = 250.00
                where buybilldetailid = 31345;
UPDATE product SET productName = '6954', productDescription = '', productCatId = '5', productBuyPrice = '250.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '0',meanbuyprice = '250.00',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15861';
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 15861;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15860';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15861', '1', '15', '1', '13616', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15862, 0, 0
                    , 250, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE buybilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250.00, meanbuyprice_withTax = 250.00, lastbuyprice_withDiscountAndTax = 250.00
                where buybilldetailid = 31346;
UPDATE product SET productName = '6956', productDescription = '', productCatId = '5', productBuyPrice = '250.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06956',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '0',meanbuyprice = '250.00',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15862';
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 15862;
UPDATE storedetail SET  productquantity = '0', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15861';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15862', '1', '15', '1', '13616', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '15', '0', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15660, 0, 0
                    , 240, 5, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET productName = 'R3248', productDescription = '', productCatId = '1', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3248',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15660';
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15660;
UPDATE storedetail SET  productquantity = '5', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15660', '1', '5', '1', '13616', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '10', '5', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15392, 0, 0
                    , 240, 5, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET productName = 'R3202', productDescription = '', productCatId = '1', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-10', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3202',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '245',meanbuyprice_withDiscount = '245' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='249',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15392';
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15392;
UPDATE storedetail SET  productquantity = '4', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15391';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15392', '1', '5', '1', '13616', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '9', '4', '77', '2024-11-05 14:06:02','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:06:02', 1, 15822, 0, 0
                    , 230, 30, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET productName = '6932', productDescription = '', productCatId = '5', productBuyPrice = '230.00', productSellAllPrice = '280.00', productSellUnitPrice = '280.00', productSellHalfPrice = '280.00', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06932',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '230',meanbuyprice_withDiscount = '230' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='230',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='230',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15822';
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 15822;
UPDATE storedetail SET  productquantity = '13', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15822', '1', '30', '1', '13616', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '43', '13', '77', '2024-11-05 14:06:02','0','0');
UPDATE supplier SET  suppliercurrentDebt = '345040',suppliercurrentDebtInCurrency= '345040' , userid = '77', supplierdate = '2024-11-05 18:47:13'   WHERE supplierid = '78';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('78', '370390.00', '25350.00', '1', 'حذف فاتورة مشتريات - للتعديل', '13616', '345040', '2024-11-05 14:06:02', '77', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','25350','1','370390','25350','345040','0');
UPDATE productserial SET del = 1
		 WHERE billid = 13616;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a0a2a8ef3b', '2024-11-05 14:15:54', '78', '345040.00', '370390', '0', '0', '25350', '25350', '0.00', '25350', '1', '2024-11-05 18:47:13', '', '77', '0', '', '1', '1','1','13616','buyBillController.php','0.00','-1','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06931', '13628', '5', '15806', '15.00', '155', '2325', '0.00', '', '2024-11-05 18:47:13', '15806','','','0','0','0','0','0',null,'155','2325','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15806, 0, 0
                    , 155, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 155,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "155" WHERE productId = 15806 ;
UPDATE buybilldetail SET  quantitybefore = 14 WHERE buybilldetailid = 31399 ;
UPDATE product SET productName = '6931', productDescription = '', productCatId = '5', productBuyPrice = '155.00', productSellAllPrice = '210.00', productSellUnitPrice = '210.00', productSellHalfPrice = '210.00', productDate = '2024-10-31', conditions = '0', userId = '77', limitamount = '1', parcode = '06931',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '155',lastbuyprice_withDiscount = '155',meanbuyprice = '155',meanbuyprice_withDiscount = '155' , productbuypricereal = '155.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='155',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='155',meanbuyprice_withTax='155',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='155'  WHERE productId = '15806';
UPDATE buybilldetail SET  lastbuyprice = 155 , meanbuyprice = 155, lastbuyprice_withDiscount = 155, meanbuyprice_withDiscount = 155
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where buybilldetailid = 31399;
UPDATE productunit SET proUnitBuyPrice  = 155 * productnumber WHERE productid = 15806;
UPDATE storedetail SET  productquantity = '29', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15805';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15806', '1', '15', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '14', '29', '77', '2024-11-05 14:15:54','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06891', '13628', '5', '15664', '15.00', '145', '2175', '0.00', '', '2024-11-05 18:47:13', '15664','','','0','0','0','0','0',null,'145','2175','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15664, 0, 0
                    , 145, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 145,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "145" WHERE productId = 15664 ;
UPDATE buybilldetail SET  quantitybefore = 26 WHERE buybilldetailid = 31400 ;
UPDATE product SET productName = '6891', productDescription = '', productCatId = '5', productBuyPrice = '145.00', productSellAllPrice = '210.00', productSellUnitPrice = '210.00', productSellHalfPrice = '210.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '06891',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '145',lastbuyprice_withDiscount = '145',meanbuyprice = '145',meanbuyprice_withDiscount = '145' , productbuypricereal = '145.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='145',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='145',meanbuyprice_withTax='145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='145'  WHERE productId = '15664';
UPDATE buybilldetail SET  lastbuyprice = 145 , meanbuyprice = 145, lastbuyprice_withDiscount = 145, meanbuyprice_withDiscount = 145
        , lastbuyprice_withTax = 145, meanbuyprice_withTax = 145, lastbuyprice_withDiscountAndTax = 145
                where buybilldetailid = 31400;
UPDATE productunit SET proUnitBuyPrice  = 145 * productnumber WHERE productid = 15664;
UPDATE storedetail SET  productquantity = '41', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15664', '1', '15', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '26', '41', '77', '2024-11-05 14:15:54','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06953', '13628', '5', '15860', '15.00', '270', '4050', '0.00', '', '2024-11-05 18:47:13', '15860','','','0','0','0','0','0',null,'270','4050','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15860, 0, 0
                    , 270, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 270,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "270" WHERE productId = 15860 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31401 ;
UPDATE product SET productName = '6953', productDescription = '', productCatId = '5', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270',lastbuyprice_withDiscount = '270',meanbuyprice = '270',meanbuyprice_withDiscount = '270' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='135',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270'  WHERE productId = '15860';
UPDATE buybilldetail SET  lastbuyprice = 270 , meanbuyprice = 270, lastbuyprice_withDiscount = 270, meanbuyprice_withDiscount = 270
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 135, lastbuyprice_withDiscountAndTax = 270
                where buybilldetailid = 31401;
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 15860;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15859';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15860', '1', '15', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 14:15:54','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06954', '13628', '5', '15861', '15.00', '250', '3750', '0.00', '', '2024-11-05 18:47:13', '15861','','','0','0','0','0','0',null,'250','3750','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15861, 0, 0
                    , 250, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 250,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "250" WHERE productId = 15861 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31402 ;
UPDATE product SET productName = '6954', productDescription = '', productCatId = '5', productBuyPrice = '250.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='125',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='250'  WHERE productId = '15861';
UPDATE buybilldetail SET  lastbuyprice = 250 , meanbuyprice = 250, lastbuyprice_withDiscount = 250, meanbuyprice_withDiscount = 250
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 125, lastbuyprice_withDiscountAndTax = 250
                where buybilldetailid = 31402;
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 15861;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15860';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15861', '1', '15', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 14:15:54','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06956', '13628', '5', '15862', '15.00', '250', '3750', '0.00', '', '2024-11-05 18:47:13', '15862','','','0','0','0','0','0',null,'250','3750','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15862, 0, 0
                    , 250, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 250,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "250" WHERE productId = 15862 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31403 ;
UPDATE product SET productName = '6956', productDescription = '', productCatId = '5', productBuyPrice = '250.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06956',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='125',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='250'  WHERE productId = '15862';
UPDATE buybilldetail SET  lastbuyprice = 250 , meanbuyprice = 250, lastbuyprice_withDiscount = 250, meanbuyprice_withDiscount = 250
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 125, lastbuyprice_withDiscountAndTax = 250
                where buybilldetailid = 31403;
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 15862;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15861';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15862', '1', '15', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 14:15:54','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3248', '13628', '1', '15660', '5.00', '240', '1200', '0.00', '', '2024-11-05 18:47:13', '15660','','','0','0','0','0','0',null,'240','1200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15660, 0, 0
                    , 240, 5, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15660 ;
UPDATE buybilldetail SET  quantitybefore = 5 WHERE buybilldetailid = 31404 ;
UPDATE product SET productName = 'R3248', productDescription = '', productCatId = '1', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3248',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15660';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 240, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 240
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31404;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15660;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15660', '1', '5', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '5', '10', '77', '2024-11-05 14:15:54','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R3202', '13628', '1', '15392', '5.00', '240', '1200', '0.00', '', '2024-11-05 18:47:13', '15392','','','0','0','0','0','0',null,'240','1200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15392, 0, 0
                    , 240, 5, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15392 ;
UPDATE buybilldetail SET  quantitybefore = 4 WHERE buybilldetailid = 31405 ;
UPDATE product SET productName = 'R3202', productDescription = '', productCatId = '1', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-10-10', conditions = '0', userId = '77', limitamount = '1', parcode = 'R3202',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '243',meanbuyprice_withDiscount = '243' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='246',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15392';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 243, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 243
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 246, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31405;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15392;
UPDATE storedetail SET  productquantity = '9', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15391';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15392', '1', '5', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '4', '9', '77', '2024-11-05 14:15:54','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06932', '13628', '5', '15822', '15', '230', '3450', '0.00', '', '2024-11-05 18:47:13', '15822','','','0','0','0','0','0',null,'230','3450','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15822, 0, 0
                    , 230, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 230,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "230" WHERE productId = 15822 ;
UPDATE buybilldetail SET  quantitybefore = 13 WHERE buybilldetailid = 31406 ;
UPDATE product SET productName = '6932', productDescription = '', productCatId = '5', productBuyPrice = '230.00', productSellAllPrice = '280.00', productSellUnitPrice = '280.00', productSellHalfPrice = '280.00', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06932',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '230',meanbuyprice_withDiscount = '230' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='230',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='230',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '15822';
UPDATE buybilldetail SET  lastbuyprice = 230 , meanbuyprice = 230, lastbuyprice_withDiscount = 230, meanbuyprice_withDiscount = 230
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where buybilldetailid = 31406;
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 15822;
UPDATE storedetail SET  productquantity = '28', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15822', '1', '15', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '13', '28', '77', '2024-11-05 14:15:54','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06952', '13628', '5', '15878', '15', '230', '3450', '0', '', '2024-11-05 18:47:13', '15878','','','0','0','0','0','0',null,'230','3450','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 14:15:54', 1, 15878, 0, 0
                    , 230, 15, 0, 0, 77, '2024-11-05 18:47:13')
                ON DUPLICATE KEY UPDATE buyprice = 230,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:47:13' ;
UPDATE product SET  productBuyPrice = "230" WHERE productId = 15878 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31407 ;
UPDATE product SET productName = '6952', productDescription = '', productCatId = '5', productBuyPrice = '230.00', productSellAllPrice = '280.00', productSellUnitPrice = '280.00', productSellHalfPrice = '280.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06952',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '230',meanbuyprice_withDiscount = '230' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='230',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '15878';
UPDATE buybilldetail SET  lastbuyprice = 230 , meanbuyprice = 230, lastbuyprice_withDiscount = 230, meanbuyprice_withDiscount = 230
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where buybilldetailid = 31407;
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 15878;
UPDATE storedetail SET  productquantity = '15', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15877';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15878', '1', '15', '0', '13628', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '77', '2024-11-05 14:15:54','0','0');
DELETE FROM productserial WHERE billid = 13616
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '370390',suppliercurrentDebtInCurrency= '370390' , userid = '77', supplierdate = '2024-11-05 18:47:13'   WHERE supplierid = '78';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('78', '345040.00', '25350', '0', 'اضافة فاتورة مشتريات', '13628', '370390', '2024-11-05 18:47:13', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','25350','1','345040','25350','370390','0');
update buybill set dailyentryid='0,' where buybillid=13628;
UPDATE product SET overAllAveragePrice = 250 WHERE productId = 15392;UPDATE product SET overAllAveragePrice = 240 WHERE productId = 15660;UPDATE product SET overAllAveragePrice = 145 WHERE productId = 15664;UPDATE product SET overAllAveragePrice = 155 WHERE productId = 15806;UPDATE product SET overAllAveragePrice = 230 WHERE productId = 15822;UPDATE product SET overAllAveragePrice = 270 WHERE productId = 15860;UPDATE product SET overAllAveragePrice = 250 WHERE productId = 15861;UPDATE product SET overAllAveragePrice = 250 WHERE productId = 15862;UPDATE product SET overAllAveragePrice = 230 WHERE productId = 15878;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:47:14', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13628');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:20", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:47:20', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:47:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:47:20', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4bfa7510a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:46:50', '0672a4bfa7510a', '1', '0.00', '0', '0', '1', '430.00', '430', '430', '0', '1', '2024-11-05 18:47:20', '', '9', '0', 'نقدي', '1', '0', '3', '96', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','430','0','','0','0','430','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143355', '0', '2024-11-05 18:47:20', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '430', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:46:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34869;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','H1455', '143355', '14', '15838', '1', '430', '430', '0', '', '1', '2024-11-05 18:47:20', '15838', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34869-1,','1','1','0','0','430','430','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 524070;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15838, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '9', storedetaildate = '2024-11-05 18:47:20' WHERE storedetailid = '15837';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15838', '1', '1', '1', '143355', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '9', '2024-11-05 18:47:20','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '43790',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('43360','430', '0', '1', 'اضافة فاتورة مبيعات', '143355', '43790', '2024-11-05 18:47:20', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 96 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 430, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 430, 350, 350
                    , 350, 350, 350, 350, 350, 350)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+430, netSellCostBuyPrice = netSellCostBuyPrice+350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4bfa7510a and sellbillId = 143355 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:47:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:47:21', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:29";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:29", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:47:29', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:35";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:35", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:47:35', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:39";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:39", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:47:39', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13616');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:40";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:40", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:47:40', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13593');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:42";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:42", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:47:42', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13569');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:46";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:47:46', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13567');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:17:48";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:47:48", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:47:48', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13545');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:18:36";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:48:36", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:48:36', '75', 'addAndRetuen', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4aea6dfec
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(216,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:42:18', '0672a4aea6dfec', '216', '-490.00', '1232', '0', '1', '1722.00', '1722', '0', '1722', '1', '2024-11-05 18:48:36', '', '75', '0', 'اية حسين P34', '2', '1', '3', '82', 'اية حسين P34', '6' ,'0','','','','','-1','0','0','0','0','0','1722','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1232', userid = '75' WHERE clientid = '216';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('216','-490.00','1722','0','اضافة فاتورة مبيعات','143356', '1232', '2024-11-05 18:48:36', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1722', '0', null, '0', null, null,'', '0','1','1','1722','1','2024-11-05 18:42:18','0','0');
UPDATE client SET  inUse = 0 where clientid = 216;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34492;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06603', '143356', '5', '15038', '1', '290', '290', '0', '', '1', '2024-11-05 18:48:36', '15038', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34492-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 232.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 232.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 207, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 524071;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15038, '2024-11-05', 290, 230, 230
                    , 232, 230, 232, 238.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+232
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 230, 230
                    , 232, 230, 232, 238.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 207, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+232
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+207
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '51', userid = '75', storedetaildate = '2024-11-05 18:48:36' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '1', '1', '143356', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52', '51', '75', '2024-11-05 18:48:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34444;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','H1376', '143356', '14', '15583', '3', '465', '1395', '0', '', '1', '2024-11-05 18:48:36', '15583', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34444-3,','1','1','0','0','465','1395','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 524072;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15583, '2024-11-05', 1395, 1140, 1140
                    , 1140, 1140, 1140, 1140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1140, 570, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1395, sellCostBuyPrice =sellCostBuyPrice+1140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+570
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1395, 1140, 1140
                    , 1140, 1140, 1140, 1140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1140, 570, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1395, sellCostBuyPrice =sellCostBuyPrice+1140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+570
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 18:48:36' WHERE storedetailid = '15582';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15583', '1', '3', '1', '143356', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '11', '75', '2024-11-05 18:48:36','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143356', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 18:48:36', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143356', '17', '10291', '1', '17', '17', '0', '', '1', '2024-11-05 18:48:36', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','17','17','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 82 where clientid = 216;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1722, 1370, 1370
                    , 1372, 1370, 1372, 1378.18
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1370, 777, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1722, sellCostBuyPrice =sellCostBuyPrice+1370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1372
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1372
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1378.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+777
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (216, '2024-11-05', 1722, 1370, 1370
                    , 1372, 1370, 1372, 1378.18
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1370, 777, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1722, sellCostBuyPrice =sellCostBuyPrice+1370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1372
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1372
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1378.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+777
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1722, 1370, 1370
                    , 1372, 1370, 1372, 1378.18, 1370, 777)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1722, netSellCostBuyPrice = netSellCostBuyPrice+1370
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1370
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1372
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1370
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1372
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1378.18
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1370
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+777;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4aea6dfec and sellbillId = 143356 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:18:37";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:48:37", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:48:37', '75', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:21:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:51:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:51:03', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4c197c75f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:47:21', '0672a4c197c75f', '1', '0.00', '0', '0', '1', '310.00', '310', '310', '0', '1', '2024-11-05 18:51:03', '', '9', '0', 'نقدي', '1', '0', '3', '5', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','310','0','','0','0','310','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143357', '0', '2024-11-05 18:51:03', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '310', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 18:47:21','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34827;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06945', '143357', '5', '15824', '1', '310', '310', '0', '', '1', '2024-11-05 18:51:03', '15824', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34827-1,','1','1','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 524075;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15824, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '9', storedetaildate = '2024-11-05 18:51:03' WHERE storedetailid = '15823';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15824', '1', '1', '1', '143357', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '9', '2024-11-05 18:51:03','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '44100',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('43790','310', '0', '1', 'اضافة فاتورة مبيعات', '143357', '44100', '2024-11-05 18:51:03', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 5 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 310, 250, 250
                    , 250, 250, 250, 250, 250, 250)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+310, netSellCostBuyPrice = netSellCostBuyPrice+250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+250
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+250
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+250
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+250
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+250;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4c197c75f and sellbillId = 143357 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:21:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:51:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:51:04', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:21:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:51:20", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:51:20', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:21:43";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:51:43", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:51:43', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a4d0886bb9', '2024-11-05 18:51:20', '228', '34735.00', '40135', '0', '0', '5400',  '5400', '0', '5400', '1', '2024-11-05 18:51:43', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1424', '13629', '14', '15711', '15', '360', '5400', '0', '', '2024-11-05 18:51:43', '15711','','','0','0','0','0','0',null,'360','5400','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:51:20', 1, 15711, 0, 0
                    , 360, 15, 0, 0, 77, '2024-11-05 18:51:43')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:51:43' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15711', '360', '15', '0', 'buyBillController.php', '31408', '', '0', '0');
UPDATE product SET  productBuyPrice = "360" WHERE productId = 15711 ;
UPDATE buybilldetail SET  quantitybefore = 5 WHERE buybilldetailid = 31408 ;
UPDATE product SET productName = 'H1424', productDescription = '', productCatId = '14', productBuyPrice = '360.00', productSellAllPrice = '490.00', productSellUnitPrice = '490.00', productSellHalfPrice = '490.00', productDate = '2024-10-28', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1424',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='360',meanbuyprice_withTax='360',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360'  WHERE productId = '15711';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 31408;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 15711;
UPDATE storedetail SET  productquantity = '20', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15711', '1', '15', '0', '13629', 'اضافة فاتورة مشتريات', 'buyBillController.php', '5', '20', '77', '2024-11-05 18:51:20','0','0');
UPDATE supplier SET  suppliercurrentDebt = '40135',suppliercurrentDebtInCurrency= '40135' , userid = '77', supplierdate = '2024-11-05 18:51:43'   WHERE supplierid = '228';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('228', '34735.00', '5400', '0', 'اضافة فاتورة مشتريات', '13629', '40135', '2024-11-05 18:51:20', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','5400','1','34735','5400','40135','0');
update buybill set dailyentryid='0,' where buybillid=13629;
COMMIT;
UPDATE product SET overAllAveragePrice = 360 WHERE productId = 15711;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:21:44";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:51:44", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:51:44', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13629');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:22:04";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:52:04", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:52:04', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:22:54";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:52:54", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:52:54', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a4d351aaa6', '2024-11-05 18:52:05', '30', '6545.00', '14170', '0', '0', '7625',  '7625', '0', '7625', '1', '2024-11-05 18:52:54', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1376', '13630', '14', '15583', '15', '380', '5700', '0', '', '2024-11-05 18:52:54', '15583','','','0','0','0','0','0',null,'380','5700','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:52:05', 1, 15583, 0, 0
                    , 380, 15, 0, 0, 77, '2024-11-05 18:52:54')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:52:54' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15583', '380', '15', '0', 'buyBillController.php', '31409', '', '0', '0');
UPDATE product SET  productBuyPrice = "380" WHERE productId = 15583 ;
UPDATE buybilldetail SET  quantitybefore = 11 WHERE buybilldetailid = 31409 ;
UPDATE product SET productName = 'H1376', productDescription = '', productCatId = '14', productBuyPrice = '380.00', productSellAllPrice = '465.00', productSellUnitPrice = '465.00', productSellHalfPrice = '465.00', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1376',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='300',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380'  WHERE productId = '15583';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 31409;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 15583;
UPDATE storedetail SET  productquantity = '26', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15582';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15583', '1', '15', '0', '13630', 'اضافة فاتورة مشتريات', 'buyBillController.php', '11', '26', '77', '2024-11-05 18:52:05','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1388', '13630', '14', '15595', '5', '385', '1925', '0', '', '2024-11-05 18:52:54', '15595','','','0','0','0','0','0',null,'385','1925','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:52:05', 1, 15595, 0, 0
                    , 385, 5, 0, 0, 77, '2024-11-05 18:52:54')
                ON DUPLICATE KEY UPDATE buyprice = 385,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:52:54' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15595', '385', '5', '0', 'buyBillController.php', '31410', '', '0', '0');
UPDATE product SET  productBuyPrice = "385" WHERE productId = 15595 ;
UPDATE buybilldetail SET  quantitybefore = 11 WHERE buybilldetailid = 31410 ;
UPDATE product SET productName = 'H1388', productDescription = '', productCatId = '14', productBuyPrice = '385.00', productSellAllPrice = '465.00', productSellUnitPrice = '465.00', productSellHalfPrice = '465.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1388',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='385',meanbuyprice_withTax='385',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='385'  WHERE productId = '15595';
UPDATE buybilldetail SET  lastbuyprice = 385 , meanbuyprice = 385, lastbuyprice_withDiscount = 385, meanbuyprice_withDiscount = 385
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where buybilldetailid = 31410;
UPDATE productunit SET proUnitBuyPrice  = 385 * productnumber WHERE productid = 15595;
UPDATE storedetail SET  productquantity = '16', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15595', '1', '5', '0', '13630', 'اضافة فاتورة مشتريات', 'buyBillController.php', '11', '16', '77', '2024-11-05 18:52:05','0','0');
UPDATE supplier SET  suppliercurrentDebt = '14170',suppliercurrentDebtInCurrency= '14170' , userid = '77', supplierdate = '2024-11-05 18:52:54'   WHERE supplierid = '30';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('30', '6545.00', '7625', '0', 'اضافة فاتورة مشتريات', '13630', '14170', '2024-11-05 18:52:05', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','7625','1','6545','7625','14170','0');
update buybill set dailyentryid='0,' where buybillid=13630;
COMMIT;
UPDATE product SET overAllAveragePrice = 380 WHERE productId = 15583;UPDATE product SET overAllAveragePrice = 385 WHERE productId = 15595;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:22:55";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:52:55", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:52:55', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13630');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:23:01";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:53:01", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:53:01', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE productunit SET unitid = '1', productid = '15841', productnumber = '1.00', productunitdate = '2024-11-02', userid = '77', conditions = '0',proUnitParcode='1584101',proUnitSellAllPrice='520',proUnitSellHalfPrice='520',proUnitSellUnitPrice ='520',proUnitBuyPrice='410',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15841';
UPDATE product SET productName = 'H1457', productDescription = '', productCatId = '14', productBuyPrice = '420', productSellAllPrice = '520', productSellUnitPrice = '520', productSellHalfPrice = '520', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1457',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '410',meanbuyprice = '415',meanbuyprice_withDiscount = '415' , productbuypricereal = '410' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410'  WHERE productId = '15841';
UPDATE productunit SET unitid = '1', productid = '15751', productnumber = '1.00', productunitdate = '2024-10-29', userid = '77', conditions = '0',proUnitParcode='1575101',proUnitSellAllPrice='630',proUnitSellHalfPrice='630',proUnitSellUnitPrice ='630',proUnitBuyPrice='560',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15751';
UPDATE product SET productName = 'H1431', productDescription = '', productCatId = '14', productBuyPrice = '565', productSellAllPrice = '630', productSellUnitPrice = '630', productSellHalfPrice = '630', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1431',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560.00',lastbuyprice_withDiscount = '560',meanbuyprice = '562.5',meanbuyprice_withDiscount = '562.5' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='560',meanbuyprice_withTax='560',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='560'  WHERE productId = '15751';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:54:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 18:54:03', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:11";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:54:11", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:54:11', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a4d6d49ba8', '2024-11-05 18:53:01', '20', '215630.00', '244155', '0', '0', '28525',  '28525', '0', '28525', '1', '2024-11-05 18:54:11', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1457', '13631', '14', '15841', '15', '420', '6300', '0', '', '2024-11-05 18:54:11', '15841','','','0','0','0','0','0',null,'420','6300','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:53:01', 1, 15841, 0, 0
                    , 420, 15, 0, 0, 77, '2024-11-05 18:54:11')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:54:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15841', '420', '15', '0', 'buyBillController.php', '31411', '', '0', '0');
UPDATE product SET  productBuyPrice = "420" WHERE productId = 15841 ;
UPDATE buybilldetail SET  quantitybefore = 23 WHERE buybilldetailid = 31411 ;
UPDATE product SET productName = 'H1457', productDescription = '', productCatId = '14', productBuyPrice = '420.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1457',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '417',meanbuyprice_withDiscount = '417' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='414',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420'  WHERE productId = '15841';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 417, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 417
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 414, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 31411;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 15841;
UPDATE storedetail SET  productquantity = '38', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15841', '1', '15', '0', '13631', 'اضافة فاتورة مشتريات', 'buyBillController.php', '23', '38', '77', '2024-11-05 18:53:01','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1431', '13631', '14', '15751', '10', '565', '5650', '0', '', '2024-11-05 18:54:11', '15751','','','0','0','0','0','0',null,'565','5650','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:53:01', 1, 15751, 0, 0
                    , 565, 10, 0, 0, 77, '2024-11-05 18:54:11')
                ON DUPLICATE KEY UPDATE buyprice = 565,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:54:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15751', '565', '10', '0', 'buyBillController.php', '31412', '', '0', '0');
UPDATE product SET  productBuyPrice = "565" WHERE productId = 15751 ;
UPDATE buybilldetail SET  quantitybefore = 7 WHERE buybilldetailid = 31412 ;
UPDATE product SET productName = 'H1431', productDescription = '', productCatId = '14', productBuyPrice = '565.00', productSellAllPrice = '630.00', productSellUnitPrice = '630.00', productSellHalfPrice = '630.00', productDate = '2024-10-29', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1431',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '565',lastbuyprice_withDiscount = '565',meanbuyprice = '564',meanbuyprice_withDiscount = '564' , productbuypricereal = '560.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='565',meanbuyprice_withTax='563',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='565'  WHERE productId = '15751';
UPDATE buybilldetail SET  lastbuyprice = 565 , meanbuyprice = 564, lastbuyprice_withDiscount = 565, meanbuyprice_withDiscount = 564
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 563, lastbuyprice_withDiscountAndTax = 565
                where buybilldetailid = 31412;
UPDATE productunit SET proUnitBuyPrice  = 565 * productnumber WHERE productid = 15751;
UPDATE storedetail SET  productquantity = '17', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15750';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15751', '1', '10', '0', '13631', 'اضافة فاتورة مشتريات', 'buyBillController.php', '7', '17', '77', '2024-11-05 18:53:01','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1408', '13631', '14', '15693', '15', '530', '7950', '0', '', '2024-11-05 18:54:11', '15693','','','0','0','0','0','0',null,'530','7950','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:53:01', 1, 15693, 0, 0
                    , 530, 15, 0, 0, 77, '2024-11-05 18:54:11')
                ON DUPLICATE KEY UPDATE buyprice = 530,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:54:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15693', '530', '15', '0', 'buyBillController.php', '31413', '', '0', '0');
UPDATE product SET  productBuyPrice = "530" WHERE productId = 15693 ;
UPDATE buybilldetail SET  quantitybefore = 16 WHERE buybilldetailid = 31413 ;
UPDATE product SET productName = 'H1408', productDescription = '', productCatId = '14', productBuyPrice = '530.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1408',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '530',meanbuyprice = '530',meanbuyprice_withDiscount = '530' , productbuypricereal = '530.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='530',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='530',meanbuyprice_withTax='530',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='530'  WHERE productId = '15693';
UPDATE buybilldetail SET  lastbuyprice = 530 , meanbuyprice = 530, lastbuyprice_withDiscount = 530, meanbuyprice_withDiscount = 530
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where buybilldetailid = 31413;
UPDATE productunit SET proUnitBuyPrice  = 530 * productnumber WHERE productid = 15693;
UPDATE storedetail SET  productquantity = '31', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15693', '1', '15', '0', '13631', 'اضافة فاتورة مشتريات', 'buyBillController.php', '16', '31', '77', '2024-11-05 18:53:01','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1369', '13631', '14', '15545', '15', '575', '8625', '0', '', '2024-11-05 18:54:11', '15545','','','0','0','0','0','0',null,'575','8625','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:53:01', 1, 15545, 0, 0
                    , 575, 15, 0, 0, 77, '2024-11-05 18:54:11')
                ON DUPLICATE KEY UPDATE buyprice = 575,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:54:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15545', '575', '15', '0', 'buyBillController.php', '31414', '', '0', '0');
UPDATE product SET  productBuyPrice = "575" WHERE productId = 15545 ;
UPDATE buybilldetail SET  quantitybefore = 7 WHERE buybilldetailid = 31414 ;
UPDATE product SET productName = 'H1369', productDescription = '', productCatId = '14', productBuyPrice = '575.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2024-10-19', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '575',lastbuyprice_withDiscount = '575',meanbuyprice = '575',meanbuyprice_withDiscount = '575' , productbuypricereal = '575.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='575',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='575',meanbuyprice_withTax='392',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='575'  WHERE productId = '15545';
UPDATE buybilldetail SET  lastbuyprice = 575 , meanbuyprice = 575, lastbuyprice_withDiscount = 575, meanbuyprice_withDiscount = 575
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 392, lastbuyprice_withDiscountAndTax = 575
                where buybilldetailid = 31414;
UPDATE productunit SET proUnitBuyPrice  = 575 * productnumber WHERE productid = 15545;
UPDATE storedetail SET  productquantity = '22', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15544';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15545', '1', '15', '0', '13631', 'اضافة فاتورة مشتريات', 'buyBillController.php', '7', '22', '77', '2024-11-05 18:53:01','0','0');
UPDATE supplier SET  suppliercurrentDebt = '244155',suppliercurrentDebtInCurrency= '244155' , userid = '77', supplierdate = '2024-11-05 18:54:11'   WHERE supplierid = '20';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('20', '215630.00', '28525', '0', 'اضافة فاتورة مشتريات', '13631', '244155', '2024-11-05 18:53:01', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','28525','1','215630','28525','244155','0');
update buybill set dailyentryid='0,' where buybillid=13631;
COMMIT;
UPDATE product SET overAllAveragePrice = 575 WHERE productId = 15545;UPDATE product SET overAllAveragePrice = 530 WHERE productId = 15693;UPDATE product SET overAllAveragePrice = 562.5 WHERE productId = 15751;UPDATE product SET overAllAveragePrice = 413.33 WHERE productId = 15841;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:12";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:54:12", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:54:12', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13631');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:18";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:54:18", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:54:18', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:54:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 18:54:19', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=add');
BEGIN;
CALL supplierInUse(137,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('137', '31280.00', '2000', '1', 'ايصال دفع لمورد', '1', '29280', '2024-11-05 18:54:03', '9', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','2000','1','0','0','0','94');
UPDATE supplierdebtchange SET supplierid = '137', supplierdebtchangebefore = '31280.00', supplierdebtchangeamount = '2000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '29280', supplierdebtchangedate = '2024-11-05 18:54:03', userid = '9', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='2000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='31280',debtchangamountInSupplierCurrency='29280',debtchangafterInSupplierCurrency='29280', paySerialNo='94' WHERE supplierdebtchangeid = '25767';
UPDATE supplier SET  suppliercurrentDebt = '29280',suppliercurrentDebtInCurrency= '29280' , userid = '9', supplierdate = '2024-11-05 18:54:20'   WHERE supplierid = '137';
UPDATE supplier SET  inUse = 0 where supplierid = 137;
UPDATE save SET  savecurrentvalue = '42100',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('44100.00','2000', '1', '1', 'ايصال دفع لمورد', '25767', '42100', '2024-11-05 18:54:20', '9',  'supplierPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2000', '2000', '2024-11-05', '9', '0', '0', '2024-11-05 18:54:20','ايصال دفع لمورد ( مصنع فلكس ) ','1','0','0','0','25767','supplierReportsController.php?do=show&id=25767');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118970', '-1', '2000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118970', '-1', '2000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-2000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE supplierdebtchange SET supplierid = '137', supplierdebtchangebefore = '31280.00', supplierdebtchangeamount = '2000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '29280.00', supplierdebtchangedate = '2024-11-05 18:54:03', userid = '9', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '118970',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='2000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='31280',debtchangamountInSupplierCurrency='29280',debtchangafterInSupplierCurrency='29280', paySerialNo='94' WHERE supplierdebtchangeid = '25767';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:54:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 18:54:20', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:54:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2024-11-05 18:54:22', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:54:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:54:23', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:54:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 18:54:33', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:24:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:54:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 18:54:41', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE productunit SET unitid = '1', productid = '15595', productnumber = '1.00', productunitdate = '2024-10-22', userid = '77', conditions = '0',proUnitParcode='1559501',proUnitSellAllPrice='465',proUnitSellHalfPrice='465',proUnitSellUnitPrice ='465',proUnitBuyPrice='385',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15595';
UPDATE product SET productName = 'H1388', productDescription = '', productCatId = '14', productBuyPrice = '380', productSellAllPrice = '465', productSellUnitPrice = '465', productSellHalfPrice = '465', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1388',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385.00',lastbuyprice_withDiscount = '385',meanbuyprice = '382.5',meanbuyprice_withDiscount = '382.5' , productbuypricereal = '385' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='385',meanbuyprice_withTax='385',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='385'  WHERE productId = '15595';
UPDATE productunit SET unitid = '1', productid = '15839', productnumber = '1.00', productunitdate = '2024-11-02', userid = '77', conditions = '0',proUnitParcode='1583901',proUnitSellAllPrice='450',proUnitSellHalfPrice='450',proUnitSellUnitPrice ='450',proUnitBuyPrice='370',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15839';
UPDATE product SET productName = 'H1452', productDescription = '', productCatId = '14', productBuyPrice = '380', productSellAllPrice = '450', productSellUnitPrice = '450', productSellHalfPrice = '450', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1452',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '375',meanbuyprice_withDiscount = '375' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='370'  WHERE productId = '15839';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:25:11";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:55:11", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:55:11', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a4dba96e8f', '2024-11-05 18:54:18', '6', '275100.00', '280800', '0', '0', '5700',  '5700', '0', '5700', '1', '2024-11-05 18:55:11', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1376', '13632', '14', '15583', '5', '380', '1900', '0', '', '2024-11-05 18:55:11', '15583','','','0','0','0','0','0',null,'380','1900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:54:18', 1, 15583, 0, 0
                    , 380, 5, 0, 0, 77, '2024-11-05 18:55:11')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:55:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15583', '380', '5', '0', 'buyBillController.php', '31415', '', '0', '0');
UPDATE product SET  productBuyPrice = "380" WHERE productId = 15583 ;
UPDATE buybilldetail SET  quantitybefore = 26 WHERE buybilldetailid = 31415 ;
UPDATE product SET productName = 'H1376', productDescription = '', productCatId = '14', productBuyPrice = '380.00', productSellAllPrice = '465.00', productSellUnitPrice = '465.00', productSellHalfPrice = '465.00', productDate = '2024-10-21', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1376',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='313',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380'  WHERE productId = '15583';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 313, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 31415;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 15583;
UPDATE storedetail SET  productquantity = '31', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15582';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15583', '1', '5', '0', '13632', 'اضافة فاتورة مشتريات', 'buyBillController.php', '26', '31', '77', '2024-11-05 18:54:18','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1452', '13632', '14', '15839', '5', '380', '1900', '0', '', '2024-11-05 18:55:11', '15839','','','0','0','0','0','0',null,'380','1900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:54:18', 1, 15839, 0, 0
                    , 380, 5, 0, 0, 77, '2024-11-05 18:55:11')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:55:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15839', '380', '5', '0', 'buyBillController.php', '31416', '', '0', '0');
UPDATE product SET  productBuyPrice = "380" WHERE productId = 15839 ;
UPDATE buybilldetail SET  quantitybefore = 3 WHERE buybilldetailid = 31416 ;
UPDATE product SET productName = 'H1452', productDescription = '', productCatId = '14', productBuyPrice = '380.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1452',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '378',meanbuyprice_withDiscount = '378' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='376',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380'  WHERE productId = '15839';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 378, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 378
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 376, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 31416;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 15839;
UPDATE storedetail SET  productquantity = '8', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15838';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15839', '1', '5', '0', '13632', 'اضافة فاتورة مشتريات', 'buyBillController.php', '3', '8', '77', '2024-11-05 18:54:18','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1388', '13632', '14', '15595', '5', '380', '1900', '0', '', '2024-11-05 18:55:11', '15595','','','0','0','0','0','0',null,'380','1900','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:54:18', 1, 15595, 0, 0
                    , 380, 5, 0, 0, 77, '2024-11-05 18:55:11')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:55:11' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15595', '380', '5', '0', 'buyBillController.php', '31417', '', '0', '0');
UPDATE product SET  productBuyPrice = "380" WHERE productId = 15595 ;
UPDATE buybilldetail SET  quantitybefore = 16 WHERE buybilldetailid = 31417 ;
UPDATE product SET productName = 'H1388', productDescription = '', productCatId = '14', productBuyPrice = '380.00', productSellAllPrice = '465.00', productSellUnitPrice = '465.00', productSellHalfPrice = '465.00', productDate = '2024-10-22', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1388',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '382',meanbuyprice_withDiscount = '382' , productbuypricereal = '385.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='384',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380'  WHERE productId = '15595';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 382, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 382
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 384, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 31417;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 15595;
UPDATE storedetail SET  productquantity = '21', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15595', '1', '5', '0', '13632', 'اضافة فاتورة مشتريات', 'buyBillController.php', '16', '21', '77', '2024-11-05 18:54:18','0','0');
UPDATE supplier SET  suppliercurrentDebt = '280800',suppliercurrentDebtInCurrency= '280800' , userid = '77', supplierdate = '2024-11-05 18:55:11'   WHERE supplierid = '6';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('6', '275100.00', '5700', '0', 'اضافة فاتورة مشتريات', '13632', '280800', '2024-11-05 18:54:18', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','5700','1','275100','5700','280800','0');
update buybill set dailyentryid='0,' where buybillid=13632;
COMMIT;
UPDATE product SET overAllAveragePrice = 380 WHERE productId = 15583;UPDATE product SET overAllAveragePrice = 384 WHERE productId = 15595;UPDATE product SET overAllAveragePrice = 375 WHERE productId = 15839;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:25:12";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:55:12", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:55:12', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13632');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:25:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:55:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:55:15', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:25:19";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:55:19", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:55:19', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE userid = 75;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:26:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:56:20", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:56:20', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:26:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:56:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 18:56:30', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:26:31";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:26:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 18:56:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 18:56:44', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE productunit SET unitid = '1', productid = '15038', productnumber = '1.00', productunitdate = '2024-09-14', userid = '77', conditions = '0',proUnitParcode='1503801',proUnitSellAllPrice='300',proUnitSellHalfPrice='300',proUnitSellUnitPrice ='300',proUnitBuyPrice='230',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15038';
UPDATE product SET productName = '6603', productDescription = '', productCatId = '5', productBuyPrice = '240', productSellAllPrice = '290', productSellUnitPrice = '290', productSellHalfPrice = '290', productDate = '2024-09-14', conditions = '0', userId = '77', limitamount = '0', parcode = '06603',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230.00',lastbuyprice_withDiscount = '230',meanbuyprice = '236',meanbuyprice_withDiscount = '236' , productbuypricereal = '230' , buypricereal_precentage = '0' , buytotal_precentage = '25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='238.18',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='230',meanbuyprice_withTax='207',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='230'  WHERE productId = '15038';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:27:00";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:57:00", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:57:00', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:27:03";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:57:03", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:57:03', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:27:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:57:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:57:14', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a4e343d75c', '2024-11-05 18:56:20', '6', '280800.00', '288000', '0', '0', '7200',  '7200', '0', '7200', '1', '2024-11-05 18:57:14', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06440', '13633', '5', '14652', '15', '240', '3600', '0', '', '2024-11-05 18:57:14', '14652','','','0','0','0','0','0',null,'240','3600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:56:20', 1, 14652, 0, 0
                    , 240, 15, 0, 0, 77, '2024-11-05 18:57:14')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:57:14' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('14652', '240', '15', '0', 'buyBillController.php', '31418', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 14652 ;
UPDATE buybilldetail SET  quantitybefore = 4 WHERE buybilldetailid = 31418 ;
UPDATE product SET productName = '6440', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2024-08-29', conditions = '0', userId = '77', limitamount = '1', parcode = '06440',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='189',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '14652';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 240, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 240
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 189, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31418;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 14652;
UPDATE storedetail SET  productquantity = '19', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '14651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14652', '1', '15', '0', '13633', 'اضافة فاتورة مشتريات', 'buyBillController.php', '4', '19', '77', '2024-11-05 18:56:20','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06603', '13633', '5', '15038', '15', '240', '3600', '0', '', '2024-11-05 18:57:14', '15038','','','0','0','0','0','0',null,'240','3600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 18:56:20', 1, 15038, 0, 0
                    , 240, 15, 0, 0, 77, '2024-11-05 18:57:14')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 18:57:14' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15038', '240', '15', '0', 'buyBillController.php', '31419', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 15038 ;
UPDATE buybilldetail SET  quantitybefore = 51 WHERE buybilldetailid = 31419 ;
UPDATE product SET productName = '6603', productDescription = '', productCatId = '5', productBuyPrice = '240.00', productSellAllPrice = '290.00', productSellUnitPrice = '290.00', productSellHalfPrice = '290.00', productDate = '2024-09-14', conditions = '0', userId = '77', limitamount = '0', parcode = '06603',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '237',meanbuyprice_withDiscount = '237' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='238.18',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='215',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '15038';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 237, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 237
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 215, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31419;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 15038;
UPDATE storedetail SET  productquantity = '66', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15037';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15038', '1', '15', '0', '13633', 'اضافة فاتورة مشتريات', 'buyBillController.php', '51', '66', '77', '2024-11-05 18:56:20','0','0');
UPDATE supplier SET  suppliercurrentDebt = '288000',suppliercurrentDebtInCurrency= '288000' , userid = '77', supplierdate = '2024-11-05 18:57:14'   WHERE supplierid = '6';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('6', '280800.00', '7200', '0', 'اضافة فاتورة مشتريات', '13633', '288000', '2024-11-05 18:56:20', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','7200','1','280800','7200','288000','0');
update buybill set dailyentryid='0,' where buybillid=13633;
COMMIT;
UPDATE product SET overAllAveragePrice = 240 WHERE productId = 14652;UPDATE product SET overAllAveragePrice = 238.33 WHERE productId = 15038;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:27:15";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:57:15", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:57:15', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13633');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:27:24";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:57:24", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:57:24', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:27:27";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:57:27", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 18:57:27', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:27:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 18:57:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 18:57:41', '9', 'showDetail', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142799');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:28:02";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 18:58:02", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 18:58:02', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=13558');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:30:51";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:00:51", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:00:51', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=details&id=12951');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:32:37";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:02:38", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:02:38', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE productunit SET unitid = '1', productid = '15694', productnumber = '1.00', productunitdate = '2024-10-25', userid = '77', conditions = '0',proUnitParcode='1569401',proUnitSellAllPrice='350',proUnitSellHalfPrice='350',proUnitSellUnitPrice ='350',proUnitBuyPrice='285',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15694';
UPDATE product SET productName = 'K781', productDescription = '', productCatId = '7', productBuyPrice = '270', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '0K781',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '285.00',lastbuyprice_withDiscount = '285',meanbuyprice = '276',meanbuyprice_withDiscount = '276' , productbuypricereal = '285' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280.91',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='285',meanbuyprice_withTax='280',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='285'  WHERE productId = '15694';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:33:13";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:03:13", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:03:13', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a4fae24f50', '2024-11-05 19:02:38', '27', '332825.00', '335525', '0', '0', '2700',  '2700', '0', '2700', '1', '2024-11-05 19:03:13', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('0K781', '13634', '7', '15694', '10', '270', '2700', '0', '', '2024-11-05 19:03:13', '15694','','','0','0','0','0','0',null,'270','2700','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:02:38', 1, 15694, 0, 0
                    , 270, 10, 0, 0, 77, '2024-11-05 19:03:13')
                ON DUPLICATE KEY UPDATE buyprice = 270,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:03:13' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15694', '270', '10', '0', 'buyBillController.php', '31420', '', '0', '0');
UPDATE product SET  productBuyPrice = "270" WHERE productId = 15694 ;
UPDATE buybilldetail SET  quantitybefore = 74 WHERE buybilldetailid = 31420 ;
UPDATE product SET productName = 'K781', productDescription = '', productCatId = '7', productBuyPrice = '270.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2024-10-25', conditions = '0', userId = '77', limitamount = '1', parcode = '0K781',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270',lastbuyprice_withDiscount = '270',meanbuyprice = '275',meanbuyprice_withDiscount = '275' , productbuypricereal = '285.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280.91',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='279',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270'  WHERE productId = '15694';
UPDATE buybilldetail SET  lastbuyprice = 270 , meanbuyprice = 275, lastbuyprice_withDiscount = 270, meanbuyprice_withDiscount = 275
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 279, lastbuyprice_withDiscountAndTax = 270
                where buybilldetailid = 31420;
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 15694;
UPDATE storedetail SET  productquantity = '84', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '10', '0', '13634', 'اضافة فاتورة مشتريات', 'buyBillController.php', '74', '84', '77', '2024-11-05 19:02:38','0','0');
UPDATE supplier SET  suppliercurrentDebt = '335525',suppliercurrentDebtInCurrency= '335525' , userid = '77', supplierdate = '2024-11-05 19:03:13'   WHERE supplierid = '27';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('27', '332825.00', '2700', '0', 'اضافة فاتورة مشتريات', '13634', '335525', '2024-11-05 19:02:38', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','2700','1','332825','2700','335525','0');
update buybill set dailyentryid='0,' where buybillid=13634;
COMMIT;
UPDATE product SET overAllAveragePrice = 280 WHERE productId = 15694;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:33:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:03:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:03:14', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13634');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:33:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:03:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 19:03:34', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:34:56";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:04:56", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:04:56', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:35:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:05:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 19:05:23', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:35:31";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:05:31", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 19:05:31', '77', 'show', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:36:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:06:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:06:00', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a5038cbec1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:04:56', '0672a5038cbec1', '1', '0.00', '0', '0', '1', '810.00', '810', '810', '0', '1', '2024-11-05 19:06:00', '', '9', '0', 'نقدي', '1', '0', '3', '4', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','810','0','','0','0','810','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143358', '0', '2024-11-05 19:06:00', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '810', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 19:04:56','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34787;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','R3246', '143358', '1', '15659', '1', '510', '510', '0', '', '1', '2024-11-05 19:06:00', '15659', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34787-1,','1','1','0','0','510','510','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 524076;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15659, '2024-11-05', 510, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 510, 410, 410
                    , 410, 410, 410, 410
                    , 0, 0, 0, 0
                    , 0, 0, 0, 410, 410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+410
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 19:06:00' WHERE storedetailid = '15658';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15659', '1', '1', '1', '143358', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 19:06:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06861', '143358', '5', '15635', '1', '300', '300', '0', '', '1', '2024-11-05 19:06:00', '15635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34892-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 236.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 236.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 232, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 524077;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15635, '2024-11-05', 300, 240, 240
                    , 236, 240, 236, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 232, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+232
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 236, 240, 236, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 232, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+232
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '34', userid = '9', storedetaildate = '2024-11-05 19:06:00' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '1', '1', '143358', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '34', '9', '2024-11-05 19:06:00','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42910',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42100','810', '0', '1', 'اضافة فاتورة مبيعات', '143358', '42910', '2024-11-05 19:06:00', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 4 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 810, 650, 650
                    , 646, 650, 646, 645
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,650, 642, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+810, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+646
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+646
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+645
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+642
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 810, 650, 650
                    , 646, 650, 646, 645
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,650, 642, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+810, sellCostBuyPrice =sellCostBuyPrice+650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+646
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+646
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+645
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+642
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 810, 650, 650
                    , 646, 650, 646, 645, 650, 642)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+810, netSellCostBuyPrice = netSellCostBuyPrice+650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+646
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+650
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+646
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+645
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+642;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a5038cbec1 and sellbillId = 143358 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:36:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:06:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:06:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:38:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:08:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:08:30', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236004
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7800,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:08:30', userid = '2' WHERE clientid = '7800';
UPDATE client SET  inUse = 0 where clientid = 7800;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7800','340.00','340','1','ايصال تحصيل (( قبض من عميل ))','236004', '0', '2024-11-05 18:56:44', '2', 'clientPayedDeptController.php', '   ', '340', '0', null, '0', null, null,'', '-1','1','1','340','1','','819','0');
UPDATE save SET  savecurrentvalue = '215944.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('215604.50','340', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236005', '215944.5', '2024-11-05 19:08:30', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '340', '340', '2024-11-05', '2', '0', '0', '2024-11-05 19:08:30','اضافة ايصال سداد للعميل سلمي هدهود W211','1','0','0','0','236005','clientPayedDeptController.php?do=show&id=236005');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118971', '-1', '340', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '340', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118971', '-1', '340', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-340', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '7800', clientdebtchangebefore = '340.000', clientdebtchangeamount = '340.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236004', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 18:56:44', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '340.00',discount='', reciptid='0', dailyentryid = '118971',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='340',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236005';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236004 -clientdebtchangeId = 236005
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:38:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:08:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:08:31', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:38:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:08:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:08:59', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236006
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9099,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '118' , clientdate = '2024-11-05 19:08:59', userid = '2' WHERE clientid = '9099';
UPDATE client SET  inUse = 0 where clientid = 9099;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9099','1058.00','940','1','ايصال تحصيل (( قبض من عميل ))','236006', '118', '2024-11-05 19:08:31', '2', 'clientPayedDeptController.php', '   ', '940', '0', null, '0', null, null,'', '-1','1','1','940','1','','820','0');
UPDATE save SET  savecurrentvalue = '216884.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('215944.50','940', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236006', '216884.5', '2024-11-05 19:08:59', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('رحمة فودة P519', 'رحمة فودة P519', 'رحمة فودة P519', 'رحمة فودة P519', '58', '0', '118.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:08:59');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '940', '940', '2024-11-05', '2', '0', '0', '2024-11-05 19:08:59','اضافة ايصال سداد للعميل رحمة فودة P519','1','0','0','0','236006','clientPayedDeptController.php?do=show&id=236006');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118972', '-1', '940', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '940', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118972', '11225', '940', '','0');
UPDATE accountstree SET name = 'رحمة فودة P519', customName = 'رحمة فودة P519', customNameEn = 'رحمة فودة P519', nameEn = 'رحمة فودة P519', parent = '58', accountNature = '0', theValue = '-822', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:08:59' WHERE id = '11225';
UPDATE clientdebtchange SET clientid = '9099', clientdebtchangebefore = '1058.000', clientdebtchangeamount = '940.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236006', clientdebtchangeafter = '118.000', clientdebtchangedate = '2024-11-05 19:08:31', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '940.00',discount='', reciptid='0', dailyentryid = '118972',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='940',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236006';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236006 -clientdebtchangeId = 236006
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:39:00";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:09:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:09:00', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:39:00";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:09:00", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:09:00', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a4b9d5c7c8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(419,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 18:45:17', '0672a4b9d5c7c8', '419', '0.00', '1323', '0', '1', '1323.00', '1323', '0', '1323', '1', '2024-11-05 19:09:00', '', '75', '0', 'نهال فاروق', '2', '1', '3', '98', 'نهال فاروق', '5' ,'0','','','','','-1','0','0','0','0','0','1323','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '1323', userid = '75' WHERE clientid = '419';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('419','0.00','1323','0','اضافة فاتورة مبيعات','143359', '1323', '2024-11-05 19:09:00', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1323', '0', null, '0', null, null,'', '0','1','1','1323','1','2024-11-05 18:45:17','0','0');
UPDATE client SET  inUse = 0 where clientid = 419;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34143;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','R3207', '143359', '1', '15414', '1', '350', '350', '0', '', '1', '2024-11-05 19:09:00', '15414', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34143-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        
                where sellbilldetailid = 524078;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15414, '2024-11-05', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 19:09:00' WHERE storedetailid = '15413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15414', '1', '1', '1', '143359', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 19:09:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34221;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06712', '143359', '5', '15227', '1', '380', '380', '0', '', '1', '2024-11-05 19:09:00', '15227', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34221-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 960, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 524079;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15227, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-2', userid = '75', storedetaildate = '2024-11-05 19:09:00' WHERE storedetailid = '15226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15227', '1', '1', '1', '143359', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-1', '-2', '75', '2024-11-05 19:09:00','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33999;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06703', '143359', '5', '15214', '1', '560', '560', '0', '', '1', '2024-11-05 19:09:00', '15214', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33999-1,','1','1','0','0','560','560','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 1089.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 1089.00
        
                where sellbilldetailid = 524080;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15214, '2024-11-05', 560, 495, 495
                    , 1089, 495, 1089, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+560, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1089
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1089
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 560, 495, 495
                    , 1089, 495, 1089, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+560, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1089
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1089
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 19:09:00' WHERE storedetailid = '15213';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15214', '1', '1', '1', '143359', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 19:09:00','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143359', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 19:09:00', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143359', '17', '10291', '1', '13', '13', '0', '', '1', '2024-11-05 19:09:00', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','13','13','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 98 where clientid = 419;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1323, 1115, 1115
                    , 1709, 1115, 1709, 1115
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1323, sellCostBuyPrice =sellCostBuyPrice+1115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1709
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1709
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (419, '2024-11-05', 1323, 1115, 1115
                    , 1709, 1115, 1709, 1115
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,320, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1323, sellCostBuyPrice =sellCostBuyPrice+1115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1709
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1709
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1323, 1115, 1115
                    , 1709, 1115, 1709, 1115, 320, 960)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1323, netSellCostBuyPrice = netSellCostBuyPrice+1115
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1115
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1709
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1115
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1709
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1115
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+320
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+960;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a4b9d5c7c8 and sellbillId = 143359 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:39:01";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:09:01", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:09:01', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:40:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:10:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:10:21', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236007
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10207,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:10:21', userid = '2' WHERE clientid = '10207';
UPDATE client SET  inUse = 0 where clientid = 10207;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10207','1469.00','1469','1','ايصال تحصيل (( قبض من عميل ))','236007', '0', '2024-11-05 19:09:00', '2', 'clientPayedDeptController.php', '   ', '1469', '0', null, '0', null, null,'', '-1','1','1','1469','1','','821','0');
UPDATE save SET  savecurrentvalue = '218353.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('216884.50','1469', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236008', '218353.5', '2024-11-05 19:10:21', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1469', '1469', '2024-11-05', '2', '0', '0', '2024-11-05 19:10:21','اضافة ايصال سداد للعميل اسماء سعيد 77 ف','1','0','0','0','236008','clientPayedDeptController.php?do=show&id=236008');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118973', '-1', '1469', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1469', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118973', '10715', '1469', '','0');
UPDATE accountstree SET name = 'اسماء سعيد 77 ف', customName = 'اسماء سعيد 77 ف', customNameEn = 'اسماء سعيد 77 ف', nameEn = 'اسماء سعيد 77 ف', parent = '58', accountNature = '0', theValue = '-1469', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-10-26 12:19:51' WHERE id = '10715';
UPDATE clientdebtchange SET clientid = '10207', clientdebtchangebefore = '1469.000', clientdebtchangeamount = '1469.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236007', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:09:00', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1469.00',discount='', reciptid='0', dailyentryid = '118973',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1469',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236008';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236007 -clientdebtchangeId = 236008
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:40:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:10:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:10:22', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:40:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:10:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:10:42', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236009
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8334,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '1' , clientdate = '2024-11-05 19:10:42', userid = '2' WHERE clientid = '8334';
UPDATE client SET  inUse = 0 where clientid = 8334;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8334','1631.00','1630','1','ايصال تحصيل (( قبض من عميل ))','236009', '1', '2024-11-05 19:10:22', '2', 'clientPayedDeptController.php', '   ', '1630', '0', null, '0', null, null,'', '-1','1','1','1630','1','','822','0');
UPDATE save SET  savecurrentvalue = '219983.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('218353.50','1630', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236009', '219983.5', '2024-11-05 19:10:42', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ياسمين احمد امينI600', 'ياسمين احمد امينI600', 'ياسمين احمد امينI600', 'ياسمين احمد امينI600', '58', '0', '1.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:10:42');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1630', '1630', '2024-11-05', '2', '0', '0', '2024-11-05 19:10:42','اضافة ايصال سداد للعميل ياسمين احمد امينI600','1','0','0','0','236009','clientPayedDeptController.php?do=show&id=236009');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118974', '-1', '1630', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1630', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118974', '11226', '1630', '','0');
UPDATE accountstree SET name = 'ياسمين احمد امينI600', customName = 'ياسمين احمد امينI600', customNameEn = 'ياسمين احمد امينI600', nameEn = 'ياسمين احمد امينI600', parent = '58', accountNature = '0', theValue = '-1629', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:10:42' WHERE id = '11226';
UPDATE clientdebtchange SET clientid = '8334', clientdebtchangebefore = '1631.000', clientdebtchangeamount = '1630.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236009', clientdebtchangeafter = '1.000', clientdebtchangedate = '2024-11-05 19:10:22', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1630.00',discount='', reciptid='0', dailyentryid = '118974',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1630',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236009';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236009 -clientdebtchangeId = 236009
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:40:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:10:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:10:43', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('اية جمال 33 م' , '', '', '01065616973', '0', '', '0', '2024-11-05 19:10:57', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10290', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10290','0','0','0','إضافة عميل جديد','10290', '0', '2024-11-05 19:10:57', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اية جمال 33 م', 'اية جمال 33 م', 'اية جمال 33 م', 'اية جمال 33 م', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 19:10:57');
UPDATE client SET clientname = 'اية جمال 33 م', clientaddress = '', clientphone = '', clientmobile = '01065616973', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11227',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10290';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:41:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:11:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:11:01', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:41:20";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:11:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:11:20', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236010
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2722,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:11:20', userid = '2' WHERE clientid = '2722';
UPDATE client SET  inUse = 0 where clientid = 2722;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2722','677.00','677','1','ايصال تحصيل (( قبض من عميل ))','236010', '0', '2024-11-05 19:10:43', '2', 'clientPayedDeptController.php', '   ', '677', '0', null, '0', null, null,'', '-1','1','1','677','1','','823','0');
UPDATE save SET  savecurrentvalue = '220660.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('219983.50','677', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236011', '220660.5', '2024-11-05 19:11:20', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ريم الباهي w341', 'ريم الباهي w341', 'ريم الباهي w341', 'ريم الباهي w341', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:11:20');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '677', '677', '2024-11-05', '2', '0', '0', '2024-11-05 19:11:20','اضافة ايصال سداد للعميل ريم الباهي w341','1','0','0','0','236011','clientPayedDeptController.php?do=show&id=236011');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118975', '-1', '677', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '677', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118975', '11228', '677', '','0');
UPDATE accountstree SET name = 'ريم الباهي w341', customName = 'ريم الباهي w341', customNameEn = 'ريم الباهي w341', nameEn = 'ريم الباهي w341', parent = '58', accountNature = '0', theValue = '-677', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:11:20' WHERE id = '11228';
UPDATE clientdebtchange SET clientid = '2722', clientdebtchangebefore = '677.000', clientdebtchangeamount = '677.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236010', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:10:43', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '677.00',discount='', reciptid='0', dailyentryid = '118975',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='677',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236011';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236010 -clientdebtchangeId = 236011
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:41:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:11:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:11:21', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:41:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:11:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 19:11:59', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:41:59";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:11:59", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:11:59', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a512dc8cd8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10290,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:09:01', '0672a512dc8cd8', '10290', '0.00', '293', '0', '1', '293.00', '293', '0', '293', '1', '2024-11-05 19:11:59', '', '75', '0', 'اية جمال 33 م', '2', '1', '3', '89', 'اية جمال 33 م', '3' ,'0','','','','','-1','0','0','0','0','0','293','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '293', userid = '75' WHERE clientid = '10290';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10290','0.00','293','0','اضافة فاتورة مبيعات','143360', '293', '2024-11-05 19:11:59', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '293', '0', null, '0', null, null,'', '0','1','1','293','1','2024-11-05 19:09:01','0','0');
UPDATE client SET  inUse = 0 where clientid = 10290;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32816;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','06474', '143360', '5', '14788', '1', '270', '270', '0', '', '1', '2024-11-05 19:11:59', '14788', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32816-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where sellbilldetailid = 524083;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14788, '2024-11-05', 270, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 19:11:59' WHERE storedetailid = '14787';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14788', '1', '1', '1', '143360', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 19:11:59','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143360', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 19:11:59', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143360', '17', '10291', '1', '3', '3', '0', '', '1', '2024-11-05 19:11:59', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','3','3','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 89 where clientid = 10290;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 293, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+293, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10290, '2024-11-05', 293, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+293, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 293, 210, 210
                    , 210, 210, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+293, netSellCostBuyPrice = netSellCostBuyPrice+210
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+210
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+210
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+210
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+210
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+210
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a512dc8cd8 and sellbillId = 143360 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:42:00";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:12:00", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:12:00', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:42:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:12:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 19:12:08', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:42:34";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:12:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:12:34', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236012
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4571,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '21' , clientdate = '2024-11-05 19:12:34', userid = '2' WHERE clientid = '4571';
UPDATE client SET  inUse = 0 where clientid = 4571;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4571','2476.00','2455','1','ايصال تحصيل (( قبض من عميل ))','236012', '21', '2024-11-05 19:11:21', '2', 'clientPayedDeptController.php', '   ', '2455', '0', null, '0', null, null,'', '-1','1','1','2455','1','','824','0');
UPDATE save SET  savecurrentvalue = '223115.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('220660.50','2455', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236013', '223115.5', '2024-11-05 19:12:34', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('تينا سدراك 33', 'تينا سدراك 33', 'تينا سدراك 33', 'تينا سدراك 33', '58', '0', '21.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:12:34');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2455', '2455', '2024-11-05', '2', '0', '0', '2024-11-05 19:12:34','اضافة ايصال سداد للعميل تينا سدراك 33','1','0','0','0','236013','clientPayedDeptController.php?do=show&id=236013');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118976', '-1', '2455', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '2455', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118976', '11229', '2455', '','0');
UPDATE accountstree SET name = 'تينا سدراك 33', customName = 'تينا سدراك 33', customNameEn = 'تينا سدراك 33', nameEn = 'تينا سدراك 33', parent = '58', accountNature = '0', theValue = '-2434', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:12:34' WHERE id = '11229';
UPDATE clientdebtchange SET clientid = '4571', clientdebtchangebefore = '2476.000', clientdebtchangeamount = '2455.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236012', clientdebtchangeafter = '21.000', clientdebtchangedate = '2024-11-05 19:11:21', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2455.00',discount='', reciptid='0', dailyentryid = '118976',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2455',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236013';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236012 -clientdebtchangeId = 236013
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:42:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:12:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:12:35', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:43:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:13:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:13:04', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236014
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7733,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '80' , clientdate = '2024-11-05 19:13:04', userid = '2' WHERE clientid = '7733';
UPDATE client SET  inUse = 0 where clientid = 7733;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7733','648.00','568','1','ايصال تحصيل (( قبض من عميل ))','236014', '80', '2024-11-05 19:12:36', '2', 'clientPayedDeptController.php', '   ', '568', '0', null, '0', null, null,'', '-1','1','1','568','1','','825','0');
UPDATE save SET  savecurrentvalue = '223683.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('223115.50','568', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236014', '223683.5', '2024-11-05 19:13:04', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اماني مصطفي I966', 'اماني مصطفي I966', 'اماني مصطفي I966', 'اماني مصطفي I966', '58', '0', '80.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:13:05');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '568', '568', '2024-11-05', '2', '0', '0', '2024-11-05 19:13:05','اضافة ايصال سداد للعميل اماني مصطفي I966','1','0','0','0','236014','clientPayedDeptController.php?do=show&id=236014');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118977', '-1', '568', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '568', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118977', '11230', '568', '','0');
UPDATE accountstree SET name = 'اماني مصطفي I966', customName = 'اماني مصطفي I966', customNameEn = 'اماني مصطفي I966', nameEn = 'اماني مصطفي I966', parent = '58', accountNature = '0', theValue = '-488', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:13:05' WHERE id = '11230';
UPDATE clientdebtchange SET clientid = '7733', clientdebtchangebefore = '648.000', clientdebtchangeamount = '568.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236014', clientdebtchangeafter = '80.000', clientdebtchangedate = '2024-11-05 19:12:36', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '568.00',discount='', reciptid='0', dailyentryid = '118977',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='568',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236014';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236014 -clientdebtchangeId = 236014
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:43:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:13:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:13:05', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:43:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:13:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:13:28', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236015
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8941,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '27' , clientdate = '2024-11-05 19:13:28', userid = '2' WHERE clientid = '8941';
UPDATE client SET  inUse = 0 where clientid = 8941;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8941','653.00','626','1','ايصال تحصيل (( قبض من عميل ))','236015', '27', '2024-11-05 19:13:05', '2', 'clientPayedDeptController.php', '   ', '626', '0', null, '0', null, null,'', '-1','1','1','626','1','','826','0');
UPDATE save SET  savecurrentvalue = '224309.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('223683.50','626', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236015', '224309.5', '2024-11-05 19:13:28', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '626', '626', '2024-11-05', '2', '0', '0', '2024-11-05 19:13:28','اضافة ايصال سداد للعميل احسان البلائسيZ530','1','0','0','0','236015','clientPayedDeptController.php?do=show&id=236015');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118978', '-1', '626', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '626', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118978', '-1', '626', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-626', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '8941', clientdebtchangebefore = '653.000', clientdebtchangeamount = '626.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236015', clientdebtchangeafter = '27.000', clientdebtchangedate = '2024-11-05 19:13:05', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '626.00',discount='', reciptid='0', dailyentryid = '118978',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='626',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236015';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236015 -clientdebtchangeId = 236015
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:43:29";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:13:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:13:29', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:43:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:13:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:13:37', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a51a57e1f5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:11:01', '0672a51a57e1f5', '1', '0.00', '0', '0', '1', '3400.00', '3400', '3400', '0', '1', '2024-11-05 19:13:37', '', '9', '0', 'نقدي', '1', '0', '3', '26', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','3400','0','','0','0','3400','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143361', '0', '2024-11-05 19:13:37', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3400', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 19:11:01','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34959;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','R3245', '143361', '1', '15677', '1', '580', '580', '0', '', '1', '2024-11-05 19:13:37', '15677', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34959-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 524086;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15677, '2024-11-05', 580, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 495, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+580, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+495
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '40', userid = '9', storedetaildate = '2024-11-05 19:13:37' WHERE storedetailid = '15676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15677', '1', '1', '1', '143361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '41', '40', '9', '2024-11-05 19:13:37','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34573;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1373', '143361', '14', '15533', '1', '550', '550', '0', '', '1', '2024-11-05 19:13:38', '15533', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34573-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 407, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 524087;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15533, '2024-11-05', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 407, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-05 19:13:38' WHERE storedetailid = '15532';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15533', '1', '1', '1', '143361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-05 19:13:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34892;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06861', '143361', '5', '15635', '1', '300', '300', '0', '', '1', '2024-11-05 19:13:38', '15635', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34892-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 236.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 236.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 232, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 524088;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15635, '2024-11-05', 300, 240, 240
                    , 236, 240, 236, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 232, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+232
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 240, 240
                    , 236, 240, 236, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 232, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+236
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+236
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+232
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '9', storedetaildate = '2024-11-05 19:13:38' WHERE storedetailid = '15634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15635', '1', '1', '1', '143361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34', '33', '9', '2024-11-05 19:13:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34662;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('245','06809', '143361', '5', '15493', '1', '300', '300', '0', '', '1', '2024-11-05 19:13:38', '15493', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34662-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 245.00 , meanbuyprice = 244.00, lastbuyprice_withDiscount = 245.00, meanbuyprice_withDiscount = 244.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 188, lastbuyprice_withDiscountAndTax = 245
                where sellbilldetailid = 524089;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15493, '2024-11-05', 300, 245, 245
                    , 244, 245, 244, 242.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 245, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+244
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+244
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+242.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 300, 245, 245
                    , 244, 245, 244, 242.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 245, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+245
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+245, sellCostMeanBuyPrice = sellCostMeanBuyPrice+244
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+245, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+244
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+242.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+245
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '9', storedetaildate = '2024-11-05 19:13:38' WHERE storedetailid = '15492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15493', '1', '1', '1', '143361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '9', '2024-11-05 19:13:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34664;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1409', '143361', '14', '15689', '1', '570', '570', '0', '', '1', '2024-11-05 19:13:38', '15689', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34664-1,','1','1','0','0','570','570','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 524090;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15689, '2024-11-05', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 570, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+570, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '26', userid = '9', storedetaildate = '2024-11-05 19:13:38' WHERE storedetailid = '15688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15689', '1', '1', '1', '143361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '26', '9', '2024-11-05 19:13:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34616;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06811', '143361', '5', '15497', '1', '200', '200', '0', '', '1', '2024-11-05 19:13:38', '15497', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34616-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        , lastbuyprice_withTax = 150, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 150
                where sellbilldetailid = 524091;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15497, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 150, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '9', storedetaildate = '2024-11-05 19:13:38' WHERE storedetailid = '15496';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15497', '1', '1', '1', '143361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '9', '2024-11-05 19:13:38','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34783;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','H1416', '143361', '14', '15796', '1', '900', '900', '0', '', '1', '2024-11-05 19:13:38', '15796', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34783-1,','1','1','0','0','900','900','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 524092;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15796, '2024-11-05', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 900, 670, 670
                    , 670, 670, 670, 670
                    , 0, 0, 0, 0
                    , 0, 0, 0, 670, 670, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+670
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+670, sellCostMeanBuyPrice = sellCostMeanBuyPrice+670
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+670, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+670
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+670
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+670
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+670
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '9', storedetaildate = '2024-11-05 19:13:38' WHERE storedetailid = '15795';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15796', '1', '1', '1', '143361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '8', '9', '2024-11-05 19:13:38','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '46310',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('42910','3400', '0', '1', 'اضافة فاتورة مبيعات', '143361', '46310', '2024-11-05 19:13:38', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 26 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 3400, 2740, 2740
                    , 2735, 2740, 2735, 2732.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2740, 2597, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+2740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2735
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2735
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2732.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2597
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 3400, 2740, 2740
                    , 2735, 2740, 2735, 2732.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2740, 2597, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+2740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2735
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2735
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2732.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2597
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3400, 2740, 2740
                    , 2735, 2740, 2735, 2732.5, 2740, 2597)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3400, netSellCostBuyPrice = netSellCostBuyPrice+2740
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2740
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2735
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2740
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2735
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2732.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2740
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2597;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a51a57e1f5 and sellbillId = 143361 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:43:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:13:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:13:39', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:44:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:14:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:14:16', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236016
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10283,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:14:16', userid = '2' WHERE clientid = '10283';
UPDATE client SET  inUse = 0 where clientid = 10283;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10283','710.00','710','1','ايصال تحصيل (( قبض من عميل ))','236016', '0', '2024-11-05 19:13:29', '2', 'clientPayedDeptController.php', '   ', '710', '0', null, '0', null, null,'', '-1','1','1','710','1','','827','0');
UPDATE save SET  savecurrentvalue = '225019.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('224309.50','710', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236017', '225019.5', '2024-11-05 19:14:16', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '710', '710', '2024-11-05', '2', '0', '0', '2024-11-05 19:14:16','اضافة ايصال سداد للعميل مرنا اسيوط 58','1','0','0','0','236017','clientPayedDeptController.php?do=show&id=236017');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118979', '-1', '710', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '710', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118979', '11207', '710', '','0');
UPDATE accountstree SET name = 'مرنا اسيوط 58', customName = 'مرنا اسيوط 58', customNameEn = 'مرنا اسيوط 58', nameEn = 'مرنا اسيوط 58', parent = '58', accountNature = '0', theValue = '-710', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-05 15:54:43' WHERE id = '11207';
UPDATE clientdebtchange SET clientid = '10283', clientdebtchangebefore = '710.000', clientdebtchangeamount = '710.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236016', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:13:29', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '710.00',discount='', reciptid='0', dailyentryid = '118979',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='710',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236017';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236016 -clientdebtchangeId = 236017
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:44:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:14:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:14:17', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:44:38";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:14:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:14:38', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236018
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10289,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-2' , clientdate = '2024-11-05 19:14:38', userid = '2' WHERE clientid = '10289';
UPDATE client SET  inUse = 0 where clientid = 10289;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10289','778.00','780','1','ايصال تحصيل (( قبض من عميل ))','236018', '-2', '2024-11-05 19:14:17', '2', 'clientPayedDeptController.php', '   ', '780', '0', null, '0', null, null,'', '-1','1','1','780','1','','828','0');
UPDATE save SET  savecurrentvalue = '225799.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('225019.50','780', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236018', '225799.5', '2024-11-05 19:14:38', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '780', '780', '2024-11-05', '2', '0', '0', '2024-11-05 19:14:38','اضافة ايصال سداد للعميل حنين احمد 43','1','0','0','0','236018','clientPayedDeptController.php?do=show&id=236018');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118980', '-1', '780', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '780', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118980', '11224', '780', '','0');
UPDATE accountstree SET name = 'حنين احمد 43', customName = 'حنين احمد 43', customNameEn = 'حنين احمد 43', nameEn = 'حنين احمد 43', parent = '58', accountNature = '0', theValue = '-780', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-05 17:55:38' WHERE id = '11224';
UPDATE clientdebtchange SET clientid = '10289', clientdebtchangebefore = '778.000', clientdebtchangeamount = '780.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236018', clientdebtchangeafter = '-2.000', clientdebtchangedate = '2024-11-05 19:14:17', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '780.00',discount='', reciptid='0', dailyentryid = '118980',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='780',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236018';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236018 -clientdebtchangeId = 236018
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:44:38";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:14:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:14:38', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:45:00";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:15:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:15:00', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236019
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7055,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:15:00', userid = '2' WHERE clientid = '7055';
UPDATE client SET  inUse = 0 where clientid = 7055;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7055','325.00','325','1','ايصال تحصيل (( قبض من عميل ))','236019', '0', '2024-11-05 19:14:38', '2', 'clientPayedDeptController.php', '   ', '325', '0', null, '0', null, null,'', '-1','1','1','325','1','','829','0');
UPDATE save SET  savecurrentvalue = '226124.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('225799.50','325', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236019', '226124.5', '2024-11-05 19:15:00', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '325', '325', '2024-11-05', '2', '0', '0', '2024-11-05 19:15:00','اضافة ايصال سداد للعميل مصطفي ابراهيم U43','1','0','0','0','236019','clientPayedDeptController.php?do=show&id=236019');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118981', '-1', '325', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '325', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118981', '-1', '325', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-325', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '7055', clientdebtchangebefore = '325.000', clientdebtchangeamount = '325.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236019', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:14:38', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '325.00',discount='', reciptid='0', dailyentryid = '118981',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='325',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236019';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236019 -clientdebtchangeId = 236019
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:45:00";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:15:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:15:00', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:45:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:15:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:15:18', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142817');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:45:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:15:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:15:21', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142868');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:45:28";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:15:28", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:15:28', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('6965','','5','200','260', '260','260', '2024-11-05', '0', '77', '1', '06965', '0', '0', '0', '0', '0', '200','200','200','200','200','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','200','200','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15879, 1,'2024-11-05 19:15:50',77)
                ON DUPLICATE KEY UPDATE productid = 15879, edited = 1, sysdate = '2024-11-05 19:15:50', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15879', '1', '2024-11-05', '77', '0','1587901','260','260','260','200','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15879', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15879', '1', '0', '0', '15879', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:46:19";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:16:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:16:19', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236020
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7700,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:16:19', userid = '2' WHERE clientid = '7700';
UPDATE client SET  inUse = 0 where clientid = 7700;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7700','177.00','177','1','ايصال تحصيل (( قبض من عميل ))','236020', '0', '2024-11-05 19:15:01', '2', 'clientPayedDeptController.php', '   ', '177', '0', null, '0', null, null,'', '-1','1','1','177','1','','830','0');
UPDATE save SET  savecurrentvalue = '226301.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('226124.50','177', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236020', '226301.5', '2024-11-05 19:16:19', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('دينا الفيوم K1008', 'دينا الفيوم K1008', 'دينا الفيوم K1008', 'دينا الفيوم K1008', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:16:19');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '177', '177', '2024-11-05', '2', '0', '0', '2024-11-05 19:16:19','اضافة ايصال سداد للعميل دينا الفيوم K1008','1','0','0','0','236020','clientPayedDeptController.php?do=show&id=236020');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118982', '-1', '177', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '177', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118982', '11231', '177', '','0');
UPDATE accountstree SET name = 'دينا الفيوم K1008', customName = 'دينا الفيوم K1008', customNameEn = 'دينا الفيوم K1008', nameEn = 'دينا الفيوم K1008', parent = '58', accountNature = '0', theValue = '-177', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:16:19' WHERE id = '11231';
UPDATE clientdebtchange SET clientid = '7700', clientdebtchangebefore = '177.000', clientdebtchangeamount = '177.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236020', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:15:01', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '177.00',discount='', reciptid='0', dailyentryid = '118982',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='177',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236020';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236020 -clientdebtchangeId = 236020
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:46:20";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:16:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:16:20', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:46:21";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:16:21", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:16:21', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a52b08d818', '2024-11-05 19:15:28', '160', '119620.00', '123620', '0', '0', '4000',  '4000', '0', '4000', '1', '2024-11-05 19:16:21', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06965', '13635', '5', '15879', '20', '200', '4000', '0', '', '2024-11-05 19:16:21', '15879','','','0','0','0','0','0',null,'200','4000','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:15:28', 1, 15879, 0, 0
                    , 200, 20, 0, 0, 77, '2024-11-05 19:16:22')
                ON DUPLICATE KEY UPDATE buyprice = 200,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:16:22' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15879', '200', '20', '0', 'buyBillController.php', '31421', '', '0', '0');
UPDATE product SET  productBuyPrice = "200" WHERE productId = 15879 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31421 ;
UPDATE product SET productName = '6965', productDescription = '', productCatId = '5', productBuyPrice = '200.00', productSellAllPrice = '260.00', productSellUnitPrice = '260.00', productSellHalfPrice = '260.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = '06965',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '200',lastbuyprice_withDiscount = '200',meanbuyprice = '200',meanbuyprice_withDiscount = '200' , productbuypricereal = '200.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='200'  WHERE productId = '15879';
UPDATE buybilldetail SET  lastbuyprice = 200 , meanbuyprice = 200, lastbuyprice_withDiscount = 200, meanbuyprice_withDiscount = 200
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where buybilldetailid = 31421;
UPDATE productunit SET proUnitBuyPrice  = 200 * productnumber WHERE productid = 15879;
UPDATE storedetail SET  productquantity = '20', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15878';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15879', '1', '20', '0', '13635', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '77', '2024-11-05 19:15:28','0','0');
UPDATE supplier SET  suppliercurrentDebt = '123620',suppliercurrentDebtInCurrency= '123620' , userid = '77', supplierdate = '2024-11-05 19:16:21'   WHERE supplierid = '160';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('160', '119620.00', '4000', '0', 'اضافة فاتورة مشتريات', '13635', '123620', '2024-11-05 19:15:28', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','4000','1','119620','4000','123620','0');
update buybill set dailyentryid='0,' where buybillid=13635;
COMMIT;
UPDATE product SET overAllAveragePrice = 200 WHERE productId = 15879;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:46:22";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:16:22", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:16:22', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13635');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:46:32";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:16:32", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 19:16:32', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13635&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:46:37";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:16:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:16:37', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236021
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9639,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '29' , clientdate = '2024-11-05 19:16:37', userid = '2' WHERE clientid = '9639';
UPDATE client SET  inUse = 0 where clientid = 9639;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9639','259.00','230','1','ايصال تحصيل (( قبض من عميل ))','236021', '29', '2024-11-05 19:16:20', '2', 'clientPayedDeptController.php', '   ', '230', '0', null, '0', null, null,'', '-1','1','1','230','1','','831','0');
UPDATE save SET  savecurrentvalue = '226531.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('226301.50','230', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236021', '226531.5', '2024-11-05 19:16:37', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('هنا عرفة e785', 'هنا عرفة e785', 'هنا عرفة e785', 'هنا عرفة e785', '58', '0', '29.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:16:37');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '230', '230', '2024-11-05', '2', '0', '0', '2024-11-05 19:16:37','اضافة ايصال سداد للعميل هنا عرفة e785','1','0','0','0','236021','clientPayedDeptController.php?do=show&id=236021');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118983', '-1', '230', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '230', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118983', '11232', '230', '','0');
UPDATE accountstree SET name = 'هنا عرفة e785', customName = 'هنا عرفة e785', customNameEn = 'هنا عرفة e785', nameEn = 'هنا عرفة e785', parent = '58', accountNature = '0', theValue = '-201', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:16:37' WHERE id = '11232';
UPDATE clientdebtchange SET clientid = '9639', clientdebtchangebefore = '259.000', clientdebtchangeamount = '230.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236021', clientdebtchangeafter = '29.000', clientdebtchangedate = '2024-11-05 19:16:20', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '230.00',discount='', reciptid='0', dailyentryid = '118983',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='230',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236021';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236021 -clientdebtchangeId = 236021
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:46:37";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:16:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:16:38', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:46:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:16:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:16:59', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236022
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6741,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:16:59', userid = '2' WHERE clientid = '6741';
UPDATE client SET  inUse = 0 where clientid = 6741;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6741','1000.00','1000','1','ايصال تحصيل (( قبض من عميل ))','236022', '0', '2024-11-05 19:16:38', '2', 'clientPayedDeptController.php', '   ', '1000', '0', null, '0', null, null,'', '-1','1','1','1000','1','','832','0');
UPDATE save SET  savecurrentvalue = '227531.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('226531.50','1000', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236022', '227531.5', '2024-11-05 19:16:59', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اسماء مجدي دمنهور 33', 'اسماء مجدي دمنهور 33', 'اسماء مجدي دمنهور 33', 'اسماء مجدي دمنهور 33', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:16:59');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1000', '1000', '2024-11-05', '2', '0', '0', '2024-11-05 19:16:59','اضافة ايصال سداد للعميل اسماء مجدي دمنهور 33','1','0','0','0','236022','clientPayedDeptController.php?do=show&id=236022');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118984', '-1', '1000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118984', '11233', '1000', '','0');
UPDATE accountstree SET name = 'اسماء مجدي دمنهور 33', customName = 'اسماء مجدي دمنهور 33', customNameEn = 'اسماء مجدي دمنهور 33', nameEn = 'اسماء مجدي دمنهور 33', parent = '58', accountNature = '0', theValue = '-1000', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:16:59' WHERE id = '11233';
UPDATE clientdebtchange SET clientid = '6741', clientdebtchangebefore = '1000.000', clientdebtchangeamount = '1000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236022', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:16:38', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1000.00',discount='', reciptid='0', dailyentryid = '118984',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1000',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236022';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236022 -clientdebtchangeId = 236022
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:47:00";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:17:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:17:00', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:47:26";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:17:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:17:26', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236023
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4756,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:17:26', userid = '2' WHERE clientid = '4756';
UPDATE client SET  inUse = 0 where clientid = 4756;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4756','8548.00','8548','1','ايصال تحصيل (( قبض من عميل ))','236023', '0', '2024-11-05 19:17:00', '2', 'clientPayedDeptController.php', '   ', '8548', '0', null, '0', null, null,'', '-1','1','1','8548','1','','833','0');
UPDATE save SET  savecurrentvalue = '236079.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('227531.50','8548', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236023', '236079.5', '2024-11-05 19:17:26', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8548', '8548', '2024-11-05', '2', '0', '0', '2024-11-05 19:17:26','اضافة ايصال سداد للعميل زوزو و طمطم F4','1','0','0','0','236023','clientPayedDeptController.php?do=show&id=236023');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118985', '-1', '8548', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '8548', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118985', '-1', '8548', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-8548', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '4756', clientdebtchangebefore = '8548.000', clientdebtchangeamount = '8548.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236023', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:17:00', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '8548.00',discount='', reciptid='0', dailyentryid = '118985',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='8548',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236023';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236023 -clientdebtchangeId = 236023
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:47:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:17:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:17:27', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:47:42";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:17:42", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 19:17:42', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:47:46";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:17:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 19:17:46', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:47:50";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:17:50", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 19:17:50', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=2390');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:47:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:17:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:17:52', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:48:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:18:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:18:17', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236024
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5812,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:18:17', userid = '2' WHERE clientid = '5812';
UPDATE client SET  inUse = 0 where clientid = 5812;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5812','1187.00','1187','1','ايصال تحصيل (( قبض من عميل ))','236024', '0', '2024-11-05 19:17:27', '2', 'clientPayedDeptController.php', '   ', '1187', '0', null, '0', null, null,'', '-1','1','1','1187','1','','834','0');
UPDATE save SET  savecurrentvalue = '237266.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('236079.50','1187', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236024', '237266.5', '2024-11-05 19:18:17', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ناريمان مجدي X69', 'ناريمان مجدي X69', 'ناريمان مجدي X69', 'ناريمان مجدي X69', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:18:17');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1187', '1187', '2024-11-05', '2', '0', '0', '2024-11-05 19:18:17','اضافة ايصال سداد للعميل ناريمان مجدي X69','1','0','0','0','236024','clientPayedDeptController.php?do=show&id=236024');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118986', '-1', '1187', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1187', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118986', '11234', '1187', '','0');
UPDATE accountstree SET name = 'ناريمان مجدي X69', customName = 'ناريمان مجدي X69', customNameEn = 'ناريمان مجدي X69', nameEn = 'ناريمان مجدي X69', parent = '58', accountNature = '0', theValue = '-1187', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:18:17' WHERE id = '11234';
UPDATE clientdebtchange SET clientid = '5812', clientdebtchangebefore = '1187.000', clientdebtchangeamount = '1187.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236024', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:17:27', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1187.00',discount='', reciptid='0', dailyentryid = '118986',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1187',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236024';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236024 -clientdebtchangeId = 236024
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:48:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:18:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:18:17', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:48:25";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:18:25", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2024-11-05 19:18:25', '77', 'details', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/returnBuyBillController.php?do=details&id=2373');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:48:38";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:18:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:18:38', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236025
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9783,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:18:38', userid = '2' WHERE clientid = '9783';
UPDATE client SET  inUse = 0 where clientid = 9783;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9783','1914.00','1914','1','ايصال تحصيل (( قبض من عميل ))','236025', '0', '2024-11-05 19:18:18', '2', 'clientPayedDeptController.php', '   ', '1914', '0', null, '0', null, null,'', '-1','1','1','1914','1','','835','0');
UPDATE save SET  savecurrentvalue = '239180.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('237266.50','1914', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236025', '239180.5', '2024-11-05 19:18:38', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('حسناء محمود 41', 'حسناء محمود 41', 'حسناء محمود 41', 'حسناء محمود 41', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:18:38');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1914', '1914', '2024-11-05', '2', '0', '0', '2024-11-05 19:18:38','اضافة ايصال سداد للعميل حسناء محمود 41','1','0','0','0','236025','clientPayedDeptController.php?do=show&id=236025');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118987', '-1', '1914', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1914', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118987', '11235', '1914', '','0');
UPDATE accountstree SET name = 'حسناء محمود 41', customName = 'حسناء محمود 41', customNameEn = 'حسناء محمود 41', nameEn = 'حسناء محمود 41', parent = '58', accountNature = '0', theValue = '-1914', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:18:38' WHERE id = '11235';
UPDATE clientdebtchange SET clientid = '9783', clientdebtchangebefore = '1914.000', clientdebtchangeamount = '1914.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236025', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:18:18', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1914.00',discount='', reciptid='0', dailyentryid = '118987',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1914',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236025';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236025 -clientdebtchangeId = 236025
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:48:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:18:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:18:39', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:48:53";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:18:53", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:18:53', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a51e091d52
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1551,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:12:00', '0672a51e091d52', '1551', '0.00', '364', '0', '1', '364.00', '364', '0', '364', '1', '2024-11-05 19:18:53', '', '75', '0', 'ام ملك الاسماعلية d1', '2', '1', '3', '81', 'ام ملك الاسماعلية d1', '3' ,'0','','','','','-1','0','0','0','0','0','364','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '364', userid = '75' WHERE clientid = '1551';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1551','0.00','364','0','اضافة فاتورة مبيعات','143362', '364', '2024-11-05 19:18:53', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '364', '0', null, '0', null, null,'', '0','1','1','364','1','2024-11-05 19:12:00','0','0');
UPDATE client SET  inUse = 0 where clientid = 1551;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34723;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','06913', '143362', '5', '15757', '1', '340', '340', '0', '', '1', '2024-11-05 19:18:53', '15757', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34723-1,','1','1','0','0','340','340','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 281.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 281.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 282, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 524093;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15757, '2024-11-05', 340, 280, 280
                    , 281, 280, 281, 282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+281
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+281
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340, 280, 280
                    , 281, 280, 281, 282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+281
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+281
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '75', storedetaildate = '2024-11-05 19:18:53' WHERE storedetailid = '15756';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15757', '1', '1', '1', '143362', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34', '33', '75', '2024-11-05 19:18:53','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143362', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 19:18:53', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143362', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-05 19:18:53', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 81 where clientid = 1551;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 364, 280, 280
                    , 281, 280, 281, 282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+364, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+281
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+281
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1551, '2024-11-05', 364, 280, 280
                    , 281, 280, 281, 282.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+364, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+281
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+281
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+282.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 364, 280, 280
                    , 281, 280, 281, 282.5, 280, 282)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+364, netSellCostBuyPrice = netSellCostBuyPrice+280
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+280
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+281
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+280
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+281
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+282.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+280
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+282;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a51e091d52 and sellbillId = 143362 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:48:54";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:18:54", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:18:54', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:49:10";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:19:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 19:19:10', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:49:45";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:19:45", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:19:45', '75', 'showDetail', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143362');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:50:06";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:20:06", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:20:06', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:50:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:20:20", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:20:20', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a53c6ece96', '2024-11-05 19:20:06', '7', '314560.00', '314800', '0', '0', '240',  '240', '0', '240', '1', '2024-11-05 19:20:21', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('R2779', '13636', '1', '13813', '1', '240', '240', '0', '', '2024-11-05 19:20:21', '13813','','','0','0','0','0','0',null,'240','240','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:20:06', 1, 13813, 0, 0
                    , 240, 1, 0, 0, 77, '2024-11-05 19:20:21')
                ON DUPLICATE KEY UPDATE buyprice = 240,
                        buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:20:21' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('13813', '240', '1', '0', 'buyBillController.php', '31422', '', '0', '0');
UPDATE product SET  productBuyPrice = "240" WHERE productId = 13813 ;
UPDATE buybilldetail SET  quantitybefore = 2 WHERE buybilldetailid = 31422 ;
UPDATE product SET productName = 'R2779', productDescription = '', productCatId = '1', productBuyPrice = '240.00', productSellAllPrice = '290.00', productSellUnitPrice = '290.00', productSellHalfPrice = '290.00', productDate = '2024-07-26', conditions = '0', userId = '77', limitamount = '1', parcode = 'R2779',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240',lastbuyprice_withDiscount = '240',meanbuyprice = '240',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='160',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240'  WHERE productId = '13813';
UPDATE buybilldetail SET  lastbuyprice = 240 , meanbuyprice = 240, lastbuyprice_withDiscount = 240, meanbuyprice_withDiscount = 240
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 240
                where buybilldetailid = 31422;
UPDATE productunit SET proUnitBuyPrice  = 240 * productnumber WHERE productid = 13813;
UPDATE storedetail SET  productquantity = '3', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '13812';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13813', '1', '1', '0', '13636', 'اضافة فاتورة مشتريات', 'buyBillController.php', '2', '3', '77', '2024-11-05 19:20:06','0','0');
UPDATE supplier SET  suppliercurrentDebt = '314800',suppliercurrentDebtInCurrency= '314800' , userid = '77', supplierdate = '2024-11-05 19:20:21'   WHERE supplierid = '7';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('7', '314560.00', '240', '0', 'اضافة فاتورة مشتريات', '13636', '314800', '2024-11-05 19:20:06', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','240','1','314560','240','314800','0');
update buybill set dailyentryid='0,' where buybillid=13636;
COMMIT;
UPDATE product SET overAllAveragePrice = 240 WHERE productId = 13813;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:50:21";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:20:21", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:20:21', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13636');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:50:27";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:20:27", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 19:20:27', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13636&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:50:41";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:20:41", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 19:20:41', '77', 'oneSupplier', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:50:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:20:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:20:44', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236024
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3321,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-5' , clientdate = '2024-11-05 19:20:44', userid = '9' WHERE clientid = '3321';
UPDATE client SET  inUse = 0 where clientid = 3321;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3321','475.00','480','1','ايصال تحصيل (( قبض من عميل ))','236024', '-5', '2024-11-05 19:17:52', '9', 'clientPayedDeptController.php', '   ', '480', '0', null, '0', null, null,'', '-1','1','1','480','1','','834','0');
UPDATE save SET  savecurrentvalue = '46790',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46310.00','480', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '236027', '46790', '2024-11-05 19:20:44', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '480', '480', '2024-11-05', '9', '0', '0', '2024-11-05 19:20:44','اضافة ايصال سداد للعميل اية مصطفي B1102','1','0','0','0','236027','clientPayedDeptController.php?do=show&id=236027');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118988', '-1', '480', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '480', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118988', '-1', '480', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-480', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3321', clientdebtchangebefore = '475.000', clientdebtchangeamount = '480.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236024', clientdebtchangeafter = '-5.000', clientdebtchangedate = '2024-11-05 19:17:52', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '480.00',discount='', reciptid='0', dailyentryid = '118988',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='480',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236027';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236024 -clientdebtchangeId = 236027
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:50:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:20:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:20:46', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:50:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:20:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:20:47', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:53:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:23:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 19:23:39', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:53:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:23:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 19:23:42', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:53:45";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:23:45", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 19:23:45', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:53:52";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:23:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:23:52', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143203');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:54:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:24:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:24:54', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:54:58";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:24:58", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:24:58', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:55:07";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:25:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:25:07', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:55:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:25:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:25:17', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143203');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:55:37";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:25:37", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:25:37', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236028
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3677,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-14590' , clientdate = '2024-11-05 19:25:37', userid = '9' WHERE clientid = '3677';
UPDATE client SET  inUse = 0 where clientid = 3677;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3677','-14575.00','15','1','ايصال تحصيل (( قبض من عميل ))','236028', '-14590', '2024-11-05 19:24:58', '9', 'clientPayedDeptController.php', '   باقي زبونه', '15', '0', null, '0', null, null,'', '-1','1','1','15','1','','836','0');
UPDATE save SET  savecurrentvalue = '46805',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46790.00','15', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '236028', '46805', '2024-11-05 19:25:37', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15', '15', '2024-11-05', '9', '0', '0', '2024-11-05 19:25:37','اضافة ايصال سداد للعميل زيادة ','1','0','0','0','236028','clientPayedDeptController.php?do=show&id=236028');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118989', '-1', '15', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '15', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118989', '-1', '15', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-15', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3677', clientdebtchangebefore = '-14575.000', clientdebtchangeamount = '15.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236028', clientdebtchangeafter = '-14590.000', clientdebtchangedate = '2024-11-05 19:24:58', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   باقي زبونه', totalOperationCost = '15.00',discount='', reciptid='0', dailyentryid = '118989',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='15',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236028';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236028 -clientdebtchangeId = 236028
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:55:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:25:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:25:38', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:55:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:25:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:25:39', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:55:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:25:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:25:40', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:55:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:25:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:25:44', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143203 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143203 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143203;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 19:25:44', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143203';
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 28, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 523433;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14524, '2024-11-05', 220, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 19:25:44' WHERE storedetailid = '14523';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14524', '1', '1', '0', '143203', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-05 12:52:06','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 29058;
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 367.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 367.00
        
                where sellbilldetailid = 523434;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12384, '2024-11-05', 235, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-235, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 220, 220
                    , 367, 220, 367, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-235, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-367
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-367
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2024-11-05 19:25:44' WHERE storedetailid = '12383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12384', '1', '1', '0', '143203', 'تعديل فاتورة مبيعات', 'sellbillController.php', '11', '12', '2', '2024-11-05 12:52:06','0','0');
CALL clientInUse(114,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-194.5', userid = '2' WHERE clientid = '114';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('114','285.50','480.00','1','تعديل فاتورة مبيعات','143203', '-194.5', '2024-11-05 12:52:06', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '480', '0', null, '0', null, null,'', '0','1','1','480','1','2024-11-05 12:52:06','0','0');
UPDATE client SET  inUse = 0 where clientid = 114;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 480, 440, 440
                    , 587, 440, 587, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-480, sellCostBuyPrice =sellCostBuyPrice-440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-587
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-587
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (114, '2024-11-05', 480, 440, 440
                    , 587, 440, 587, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-480, sellCostBuyPrice =sellCostBuyPrice-440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-587
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-587
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 480, 440, 440
                    , 587, 440, 587, 440, 220, 28)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-480, netSellCostBuyPrice = netSellCostBuyPrice-440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-587
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-587
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-440
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-28;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143203 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143203 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(114,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 12:52:06', '06729f8d68cec0', '114', '-194.50', '17.5', '0', '1', '212', '212', '0', '212', '1', '2024-11-05 12:52:06', '', '2', '0', 'عواطف نبيل P77', '2', '1', '3', '82', 'عواطف نبيل P77', '3', '143203', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '17.5', userid = '2' WHERE clientid = '114';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('114','-194.50','212','0','اضافة فاتورة مبيعات (معدله)','143363', '17.5', '2024-11-05 19:25:44', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '212', '0', null, '0', null, null,'', '0','1','1','480','1','2024-11-05 12:52:06','0','0');
UPDATE client SET  inUse = 0 where clientid = 114;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','06361', '143363', '5', '14524', '1', '190', '190', '0', '', '1', '2024-11-05 19:25:44', '14524', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 28, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 524096;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14524, '2024-11-05', 190, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 19:25:44' WHERE storedetailid = '14523';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14524', '1', '1', '1', '143363', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '5', '2', '2024-11-05 19:25:44','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143363', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 19:25:44', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143363', '17', '10291', '1', '2', '2', '0', '', '1', '2024-11-05 19:25:44', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2','2','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 212, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+212, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (114, '2024-11-05', 212, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+212, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 212, 220, 220
                    , 220, 220, 220, 220, 220, 28)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+212, netSellCostBuyPrice = netSellCostBuyPrice+220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+220
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+28;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143203 and newid=143363 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:55:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:25:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:25:45', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143363');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:56:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:26:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:26:08', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a551405fb4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:25:40', '0672a551405fb4', '1', '0.00', '0', '0', '1', '390.00', '390', '390', '0', '1', '2024-11-05 19:26:09', '', '9', '0', 'نقدي', '1', '0', '3', '94', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','390','0','','0','0','390','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143364', '0', '2024-11-05 19:26:09', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '390', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 19:25:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34405;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','H1374', '143364', '14', '15555', '1', '390', '390', '0', '', '1', '2024-11-05 19:26:09', '15555', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34405-1,','1','1','0','0','390','390','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 5034, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 524099;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15555, '2024-11-05', 390, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 5034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 390, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 5034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '9', storedetaildate = '2024-11-05 19:26:09' WHERE storedetailid = '15554';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15555', '1', '1', '1', '143364', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '22', '9', '2024-11-05 19:26:09','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '47195',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('46805','390', '0', '1', 'اضافة فاتورة مبيعات', '143364', '47195', '2024-11-05 19:26:09', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 94 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 390, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 5034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 390, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,330, 5034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 390, 330, 330
                    , 330, 330, 330, 330, 330, 5034)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+390, netSellCostBuyPrice = netSellCostBuyPrice+330
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+330
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+330
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+330
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5034;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a551405fb4 and sellbillId = 143364 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:56:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:26:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:26:09', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:56:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:26:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:26:53', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:57:07";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:27:07", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:27:07', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'خشبه', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '47095',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('47195.00','100', '1', '1', 'إضافة مصروف', '24293', '47095', '2024-11-05 19:27:07', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'خشبه', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24293';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:57:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:27:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:27:08', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:57:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:27:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:27:10', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:57:28";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:27:28", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:27:28', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:57:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:27:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:27:35', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:58:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:28:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:28:18', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:58:24";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:28:24", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2024-11-05 19:28:24', '77', '', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/storereportController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:58:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:28:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:28:28', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=142759&action=');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 142759
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 142759;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 19:28:28', userid = '2',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '142759';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34396;
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        
                where sellbilldetailid = 521737;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15294, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 19:28:28' WHERE storedetailid = '15293';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15294', '1', '1', '0', '142759', 'حذف فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-05 19:28:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34222;
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 480.00
        
                where sellbilldetailid = 521738;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15488, '2024-11-05', 540, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-540, sellCostBuyPrice =sellCostBuyPrice-480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-480, sellCostMeanBuyPrice = sellCostMeanBuyPrice-480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 540, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-540, sellCostBuyPrice =sellCostBuyPrice-480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-480, sellCostMeanBuyPrice = sellCostMeanBuyPrice-480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '17', userid = '2', storedetaildate = '2024-11-05 19:28:28' WHERE storedetailid = '15487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15488', '1', '1', '0', '142759', 'حذف فاتورة مبيعات', 'sellbillController.php', '16', '17', '2', '2024-11-05 19:28:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34439;
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        
                where sellbilldetailid = 521739;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15579, '2024-11-05', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-340, sellCostBuyPrice =sellCostBuyPrice-285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-285, sellCostMeanBuyPrice = sellCostMeanBuyPrice-285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 340, 285, 285
                    , 285, 285, 285, 285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-340, sellCostBuyPrice =sellCostBuyPrice-285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-285, sellCostMeanBuyPrice = sellCostMeanBuyPrice-285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2024-11-05 19:28:28' WHERE storedetailid = '15578';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15579', '1', '1', '0', '142759', 'حذف فاتورة مبيعات', 'sellbillController.php', '6', '7', '2', '2024-11-05 19:28:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34500;
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 521740;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15630, '2024-11-05', 230, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-230, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-165
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 230, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-230, sellCostBuyPrice =sellCostBuyPrice-165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-165
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '11', userid = '2', storedetaildate = '2024-11-05 19:28:28' WHERE storedetailid = '15629';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15630', '1', '1', '0', '142759', 'حذف فاتورة مبيعات', 'sellbillController.php', '10', '11', '2', '2024-11-05 19:28:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 28558;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 269.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 269.00
        
                where sellbilldetailid = 521741;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11928, '2024-11-05', 310, 270, 270
                    , 269, 270, 269, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-310, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 270, 270
                    , 269, 270, 269, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-310, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2024-11-05 19:28:28' WHERE storedetailid = '11927';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11928', '1', '1', '0', '142759', 'حذف فاتورة مبيعات', 'sellbillController.php', '11', '12', '2', '2024-11-05 19:28:28','0','0');
CALL clientInUse(10224,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '10224';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10224','1675.00','1675.00','1','حذف فاتورة مبيعات','142759', '0', '2024-11-05 19:28:28', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '1675', '0', null, '0', null, null,'', '0','1','1','1675','1','2024-10-28 16:51:31','0','0');
UPDATE client SET  inUse = 0 where clientid = 10224;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1675, 1365, 1365
                    , 1364, 1365, 1364, 1365
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1675, sellCostBuyPrice =sellCostBuyPrice-1365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1365, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1364
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1364
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-165
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10224, '2024-11-05', 1675, 1365, 1365
                    , 1364, 1365, 1364, 1365
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1675, sellCostBuyPrice =sellCostBuyPrice-1365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1365, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1364
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1364
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1365
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-165
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1675, 1365, 1365
                    , 1364, 1365, 1364, 1365, 165, 165)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-1675, netSellCostBuyPrice = netSellCostBuyPrice-1365
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1365
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1364
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1365
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1364
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1365
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-165
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-165;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 142759
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:58:29";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:28:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:28:29', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 15:58:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:28:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:28:31', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:00:42";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:30:42", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:30:42', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a5580b6938
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1927,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:27:28', '0672a5580b6938', '1927', '619.00', '973', '0', '1', '354.00', '354', '0', '354', '1', '2024-11-05 19:30:42', '', '75', '0', 'اية محمد كفر الشيخ 52', '2', '1', '3', '80', 'اية محمد كفر الشيخ 52', '2' ,'0','','','','','-1','0','0','0','0','0','354','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '973', userid = '75' WHERE clientid = '1927';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1927','619.00','354','0','اضافة فاتورة مبيعات','143365', '973', '2024-11-05 19:30:42', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '354', '0', null, '0', null, null,'', '0','1','1','354','1','2024-11-05 19:27:28','0','0');
UPDATE client SET  inUse = 0 where clientid = 1927;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30924;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('290','0A272', '143365', '6', '13929', '1', '350', '350', '0', '', '1', '2024-11-05 19:30:42', '13929', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30924-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 290.00 , meanbuyprice = 290.00, lastbuyprice_withDiscount = 290.00, meanbuyprice_withDiscount = 290.00
        
                where sellbilldetailid = 524100;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13929, '2024-11-05', 350, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 19:30:42' WHERE storedetailid = '13928';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13929', '1', '1', '1', '143365', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 19:30:42','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143365', '17', '10291', '1', '4', '4', '0', '', '1', '2024-11-05 19:30:42', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4','4','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 80 where clientid = 1927;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 354, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+354, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1927, '2024-11-05', 354, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+354, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 354, 290, 290
                    , 290, 290, 290, 290, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+354, netSellCostBuyPrice = netSellCostBuyPrice+290
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+290
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+290
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+290
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+290
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+290
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a5580b6938 and sellbillId = 143365 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:00:43";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:30:43", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:30:43', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:04:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:34:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 19:34:09', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:04:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:34:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:34:38', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:04:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:34:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:34:49', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ضحيه', '', '12000', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '35095',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('47095.00','12000', '1', '1', 'إضافة مصروف', '24294', '35095', '2024-11-05 19:34:49', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ضحيه', expensesdetails = '', expensesValue = '12000.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24294';
COMMIT;
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount) VALUES ('افنان محسن 41 م' , '', '', '01095808611', '0', '', '0', '2024-11-05 19:34:49', '75', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2024-11-05','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('10291', '0', '0', '', '');
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10291','0','0','0','إضافة عميل جديد','10291', '0', '2024-11-05 19:34:49', '75', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('افنان محسن 41 م', 'افنان محسن 41 م', 'افنان محسن 41 م', 'افنان محسن 41 م', '58', '0', '0', '0', '', '0', '0', '', '0', '3', '1', '', '75', '0', '2024-11-05 19:34:49');
UPDATE client SET clientname = 'افنان محسن 41 م', clientaddress = '', clientphone = '', clientmobile = '01095808611', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2024-11-05', userid = '75'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',-20,',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='11236',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00' WHERE clientid = '10291';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:04:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:34:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:34:49', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:04:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:34:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 19:34:51', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:05:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:35:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:35:05', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:06:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:36:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:36:19', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a5749d5011
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:35:05', '0672a5749d5011', '1', '0.00', '0', '0', '1', '150.00', '150', '150', '0', '1', '2024-11-05 19:36:19', '', '9', '0', 'نقدي', '1', '0', '3', '97', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','150','0','','0','0','150','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143366', '0', '2024-11-05 19:36:19', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '150', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 19:35:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 27274;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','05575', '143366', '5', '12144', '1', '150', '150', '0', '', '1', '2024-11-05 19:36:19', '12144', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','27274-1,','1','1','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        
                where sellbilldetailid = 524102;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12144, '2024-11-05', 150, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 19:36:19' WHERE storedetailid = '12143';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12144', '1', '1', '1', '143366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 19:36:19','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '35245',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35095','150', '0', '1', 'اضافة فاتورة مبيعات', '143366', '35245', '2024-11-05 19:36:19', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 97 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 150, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 310, 310
                    , 310, 310, 310, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 150, 310, 310
                    , 310, 310, 310, 310, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+150, netSellCostBuyPrice = netSellCostBuyPrice+310
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+310
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+310
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+310
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+310
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+310
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a5749d5011 and sellbillId = 143366 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:06:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:36:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:36:19', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:06:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:36:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:36:44', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:06:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:36:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:36:53', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'رغدة', '', '200', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '35045',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35245.00','200', '1', '1', 'إضافة مصروف', '24295', '35045', '2024-11-05 19:36:53', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'رغدة', expensesdetails = '', expensesValue = '200.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24295';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:06:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:36:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:36:53', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:06:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:36:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:36:55', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:07:36";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:37:36", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:37:36', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:07:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:37:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:37:43', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:07:51";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:37:51", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:37:51', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a57e03f6fe', '2024-11-05 19:37:36', '19', '228700.00', '230800', '0', '0', '2100',  '2100', '0', '2100', '1', '2024-11-05 19:37:51', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('06934', '13637', '5', '15820', '15', '140', '2100', '0', '', '2024-11-05 19:37:51', '15820','','','0','0','0','0','0',null,'140','2100','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:37:36', 1, 15820, 0, 0
                    , 140, 15, 0, 0, 77, '2024-11-05 19:37:52')
                ON DUPLICATE KEY UPDATE buyprice = 140,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:37:52' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15820', '140', '15', '0', 'buyBillController.php', '31423', '', '0', '0');
UPDATE product SET  productBuyPrice = "140" WHERE productId = 15820 ;
UPDATE buybilldetail SET  quantitybefore = 27 WHERE buybilldetailid = 31423 ;
UPDATE product SET productName = '6934', productDescription = '', productCatId = '5', productBuyPrice = '140.00', productSellAllPrice = '200.00', productSellUnitPrice = '200.00', productSellHalfPrice = '200.00', productDate = '2024-11-01', conditions = '0', userId = '77', limitamount = '1', parcode = '06934',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '141',meanbuyprice_withDiscount = '141' , productbuypricereal = '145.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='142.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='140',meanbuyprice_withTax='141',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='140'  WHERE productId = '15820';
UPDATE buybilldetail SET  lastbuyprice = 140 , meanbuyprice = 141, lastbuyprice_withDiscount = 140, meanbuyprice_withDiscount = 141
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 141, lastbuyprice_withDiscountAndTax = 140
                where buybilldetailid = 31423;
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 15820;
UPDATE storedetail SET  productquantity = '42', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15819';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15820', '1', '15', '0', '13637', 'اضافة فاتورة مشتريات', 'buyBillController.php', '27', '42', '77', '2024-11-05 19:37:36','0','0');
UPDATE supplier SET  suppliercurrentDebt = '230800',suppliercurrentDebtInCurrency= '230800' , userid = '77', supplierdate = '2024-11-05 19:37:51'   WHERE supplierid = '19';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('19', '228700.00', '2100', '0', 'اضافة فاتورة مشتريات', '13637', '230800', '2024-11-05 19:37:36', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','2100','1','228700','2100','230800','0');
update buybill set dailyentryid='0,' where buybillid=13637;
COMMIT;
UPDATE product SET overAllAveragePrice = 141.67 WHERE productId = 15820;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:07:52";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:37:52", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:37:52', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13637');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:07:58";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:37:58", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 19:37:58', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13637&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:08:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:38:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:38:06', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:08:12";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:38:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:38:12', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236036
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1221,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '10' , clientdate = '2024-11-05 19:38:12', userid = '2' WHERE clientid = '1221';
UPDATE client SET  inUse = 0 where clientid = 1221;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1221','763.00','753','1','ايصال تحصيل (( قبض من عميل ))','236036', '10', '2024-11-05 19:37:43', '2', 'clientPayedDeptController.php', '   ', '753', '0', null, '0', null, null,'', '-1','1','1','753','1','','837','0');
UPDATE save SET  savecurrentvalue = '239933.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('239180.50','753', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236036', '239933.5', '2024-11-05 19:38:12', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '753', '753', '2024-11-05', '2', '0', '0', '2024-11-05 19:38:12','اضافة ايصال سداد للعميل نور عبد الله 14','1','0','0','0','236036','clientPayedDeptController.php?do=show&id=236036');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118990', '-1', '753', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '753', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118990', '-1', '753', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-753', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '1221', clientdebtchangebefore = '763.000', clientdebtchangeamount = '753.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236036', clientdebtchangeafter = '10.000', clientdebtchangedate = '2024-11-05 19:37:43', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '753.00',discount='', reciptid='0', dailyentryid = '118990',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='753',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236036';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236036 -clientdebtchangeId = 236036
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:08:13";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:38:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:38:13', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:08:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:38:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:38:26', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'دنيا عماد', '', '200', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '34845',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35045.00','200', '1', '1', 'إضافة مصروف', '24296', '34845', '2024-11-05 19:38:26', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'دنيا عماد', expensesdetails = '', expensesValue = '200.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24296';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:08:26";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:38:26", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:38:26', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:08:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:38:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 19:38:28', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:08:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:38:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:38:39', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236037
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10290,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '23' , clientdate = '2024-11-05 19:38:39', userid = '2' WHERE clientid = '10290';
UPDATE client SET  inUse = 0 where clientid = 10290;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10290','293.00','270','1','ايصال تحصيل (( قبض من عميل ))','236037', '23', '2024-11-05 19:38:13', '2', 'clientPayedDeptController.php', '   ', '270', '0', null, '0', null, null,'', '-1','1','1','270','1','','838','0');
UPDATE save SET  savecurrentvalue = '240203.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('239933.50','270', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236037', '240203.5', '2024-11-05 19:38:39', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '270', '270', '2024-11-05', '2', '0', '0', '2024-11-05 19:38:39','اضافة ايصال سداد للعميل اية جمال 33 م','1','0','0','0','236037','clientPayedDeptController.php?do=show&id=236037');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118991', '-1', '270', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '270', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118991', '11227', '270', '','0');
UPDATE accountstree SET name = 'اية جمال 33 م', customName = 'اية جمال 33 م', customNameEn = 'اية جمال 33 م', nameEn = 'اية جمال 33 م', parent = '58', accountNature = '0', theValue = '-270', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-05 19:10:57' WHERE id = '11227';
UPDATE clientdebtchange SET clientid = '10290', clientdebtchangebefore = '293.000', clientdebtchangeamount = '270.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236037', clientdebtchangeafter = '23.000', clientdebtchangedate = '2024-11-05 19:38:13', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '270.00',discount='', reciptid='0', dailyentryid = '118991',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='270',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236037';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236037 -clientdebtchangeId = 236037
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:08:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:38:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:38:40', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:09:03";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:39:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:39:03', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236038
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7907,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:39:03', userid = '2' WHERE clientid = '7907';
UPDATE client SET  inUse = 0 where clientid = 7907;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7907','1273.00','1273','1','ايصال تحصيل (( قبض من عميل ))','236038', '0', '2024-11-05 19:38:40', '2', 'clientPayedDeptController.php', '   ', '1273', '0', null, '0', null, null,'', '-1','1','1','1273','1','','839','0');
UPDATE save SET  savecurrentvalue = '241476.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('240203.50','1273', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236038', '241476.5', '2024-11-05 19:39:03', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('شيماء الزناتي x225', 'شيماء الزناتي x225', 'شيماء الزناتي x225', 'شيماء الزناتي x225', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:39:03');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1273', '1273', '2024-11-05', '2', '0', '0', '2024-11-05 19:39:03','اضافة ايصال سداد للعميل شيماء الزناتي x225','1','0','0','0','236038','clientPayedDeptController.php?do=show&id=236038');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118992', '-1', '1273', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1273', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118992', '11237', '1273', '','0');
UPDATE accountstree SET name = 'شيماء الزناتي x225', customName = 'شيماء الزناتي x225', customNameEn = 'شيماء الزناتي x225', nameEn = 'شيماء الزناتي x225', parent = '58', accountNature = '0', theValue = '-1273', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:39:03' WHERE id = '11237';
UPDATE clientdebtchange SET clientid = '7907', clientdebtchangebefore = '1273.000', clientdebtchangeamount = '1273.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236038', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:38:40', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1273.00',discount='', reciptid='0', dailyentryid = '118992',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1273',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236038';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236038 -clientdebtchangeId = 236038
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:09:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:39:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:39:04', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:09:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:39:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:39:24', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236039
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4719,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:39:24', userid = '2' WHERE clientid = '4719';
UPDATE client SET  inUse = 0 where clientid = 4719;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4719','838.00','838','1','ايصال تحصيل (( قبض من عميل ))','236039', '0', '2024-11-05 19:39:04', '2', 'clientPayedDeptController.php', '   ', '838', '0', null, '0', null, null,'', '-1','1','1','838','1','','840','0');
UPDATE save SET  savecurrentvalue = '242314.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('241476.50','838', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236039', '242314.5', '2024-11-05 19:39:24', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('هاجر سيد 2207', 'هاجر سيد 2207', 'هاجر سيد 2207', 'هاجر سيد 2207', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:39:24');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '838', '838', '2024-11-05', '2', '0', '0', '2024-11-05 19:39:24','اضافة ايصال سداد للعميل هاجر سيد 2207','1','0','0','0','236039','clientPayedDeptController.php?do=show&id=236039');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118993', '-1', '838', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '838', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118993', '11238', '838', '','0');
UPDATE accountstree SET name = 'هاجر سيد 2207', customName = 'هاجر سيد 2207', customNameEn = 'هاجر سيد 2207', nameEn = 'هاجر سيد 2207', parent = '58', accountNature = '0', theValue = '-838', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:39:24' WHERE id = '11238';
UPDATE clientdebtchange SET clientid = '4719', clientdebtchangebefore = '838.000', clientdebtchangeamount = '838.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236039', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:39:04', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '838.00',discount='', reciptid='0', dailyentryid = '118993',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='838',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236039';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236039 -clientdebtchangeId = 236039
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:09:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:39:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:39:25', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:09:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:39:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:39:43', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:09:49";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:39:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:39:49', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236040
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9513,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '15' , clientdate = '2024-11-05 19:39:49', userid = '2' WHERE clientid = '9513';
UPDATE client SET  inUse = 0 where clientid = 9513;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9513','813.00','798','1','ايصال تحصيل (( قبض من عميل ))','236040', '15', '2024-11-05 19:39:25', '2', 'clientPayedDeptController.php', '   ', '798', '0', null, '0', null, null,'', '-1','1','1','798','1','','841','0');
UPDATE save SET  savecurrentvalue = '243112.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('242314.50','798', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236040', '243112.5', '2024-11-05 19:39:49', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اسماء سعيد 100', 'اسماء سعيد 100', 'اسماء سعيد 100', 'اسماء سعيد 100', '58', '0', '15.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:39:49');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '798', '798', '2024-11-05', '2', '0', '0', '2024-11-05 19:39:49','اضافة ايصال سداد للعميل اسماء سعيد 100','1','0','0','0','236040','clientPayedDeptController.php?do=show&id=236040');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118994', '-1', '798', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '798', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118994', '11239', '798', '','0');
UPDATE accountstree SET name = 'اسماء سعيد 100', customName = 'اسماء سعيد 100', customNameEn = 'اسماء سعيد 100', nameEn = 'اسماء سعيد 100', parent = '58', accountNature = '0', theValue = '-783', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:39:49' WHERE id = '11239';
UPDATE clientdebtchange SET clientid = '9513', clientdebtchangebefore = '813.000', clientdebtchangeamount = '798.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236040', clientdebtchangeafter = '15.000', clientdebtchangedate = '2024-11-05 19:39:25', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '798.00',discount='', reciptid='0', dailyentryid = '118994',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='798',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236040';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236040 -clientdebtchangeId = 236040
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:09:50";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:39:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:39:50', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:10:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:40:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:40:44', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236041
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9360,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '298' , clientdate = '2024-11-05 19:40:45', userid = '2' WHERE clientid = '9360';
UPDATE client SET  inUse = 0 where clientid = 9360;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9360','1025.00','727','1','ايصال تحصيل (( قبض من عميل ))','236041', '298', '2024-11-05 19:39:50', '2', 'clientPayedDeptController.php', '   ', '727', '0', null, '0', null, null,'', '-1','1','1','727','1','','842','0');
UPDATE save SET  savecurrentvalue = '243839.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('243112.50','727', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236041', '243839.5', '2024-11-05 19:40:45', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ندي بدوي W689', 'ندي بدوي W689', 'ندي بدوي W689', 'ندي بدوي W689', '58', '0', '298.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:40:45');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '727', '727', '2024-11-05', '2', '0', '0', '2024-11-05 19:40:45','اضافة ايصال سداد للعميل ندي بدوي W689','1','0','0','0','236041','clientPayedDeptController.php?do=show&id=236041');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118995', '-1', '727', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '727', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118995', '11240', '727', '','0');
UPDATE accountstree SET name = 'ندي بدوي W689', customName = 'ندي بدوي W689', customNameEn = 'ندي بدوي W689', nameEn = 'ندي بدوي W689', parent = '58', accountNature = '0', theValue = '-429', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:40:45' WHERE id = '11240';
UPDATE clientdebtchange SET clientid = '9360', clientdebtchangebefore = '1025.000', clientdebtchangeamount = '727.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236041', clientdebtchangeafter = '298.000', clientdebtchangedate = '2024-11-05 19:39:50', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '727.00',discount='', reciptid='0', dailyentryid = '118995',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='727',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236041';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236041 -clientdebtchangeId = 236041
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:10:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:40:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:40:45', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:11:32";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:41:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:41:32', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236042
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10282,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:41:33', userid = '2' WHERE clientid = '10282';
UPDATE client SET  inUse = 0 where clientid = 10282;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10282','1010.00','1010','1','ايصال تحصيل (( قبض من عميل ))','236042', '0', '2024-11-05 19:40:45', '2', 'clientPayedDeptController.php', '   ', '1010', '0', null, '0', null, null,'', '-1','1','1','1010','1','','843','0');
UPDATE save SET  savecurrentvalue = '244849.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('243839.50','1010', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236042', '244849.5', '2024-11-05 19:41:33', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1010', '1010', '2024-11-05', '2', '0', '0', '2024-11-05 19:41:33','اضافة ايصال سداد للعميل جهاد محمد ','1','0','0','0','236042','clientPayedDeptController.php?do=show&id=236042');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118996', '-1', '1010', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1010', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118996', '11206', '1010', '','0');
UPDATE accountstree SET name = 'جهاد محمد ', customName = 'جهاد محمد ', customNameEn = 'جهاد محمد ', nameEn = 'جهاد محمد ', parent = '58', accountNature = '0', theValue = '-1010', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-11-05 15:20:01' WHERE id = '11206';
UPDATE clientdebtchange SET clientid = '10282', clientdebtchangebefore = '1010.000', clientdebtchangeamount = '1010.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236042', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:40:45', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1010.00',discount='', reciptid='0', dailyentryid = '118996',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1010',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236042';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236042 -clientdebtchangeId = 236042
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:11:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:41:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:41:33', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:11:35";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:41:35", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:41:35', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a5643efd71
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10291,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:30:43', '0672a5643efd71', '10291', '0.00', '3277', '0', '1', '3277.00', '3277', '0', '3277', '1', '2024-11-05 19:41:36', '', '75', '0', 'افنان محسن 41 م', '2', '1', '3', '87', 'افنان محسن 41 م', '15' ,'0','','','','','-1','0','0','0','0','0','3277','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '3277', userid = '75' WHERE clientid = '10291';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10291','0.00','3277','0','اضافة فاتورة مبيعات','143367', '3277', '2024-11-05 19:41:36', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3277', '0', null, '0', null, null,'', '0','1','1','3277','1','2024-11-05 19:30:43','0','0');
UPDATE client SET  inUse = 0 where clientid = 10291;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 26588;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05447', '143367', '5', '11863', '2', '437.5', '875', '0', '', '1', '2024-11-05 19:41:36', '11863', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26588-2,','1','1','0','0','437.5','875','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 488.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 488.00
        
                where sellbilldetailid = 524103;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11863, '2024-11-05', 875, 990, 990
                    , 976, 990, 976, 975
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+875, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+976
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+976
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+975
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 875, 990, 990
                    , 976, 990, 976, 975
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+875, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+976
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+976
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+975
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '11862';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11863', '1', '2', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '4', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29455;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('385','05849', '143367', '5', '13001', '1', '290', '290', '0', '', '1', '2024-11-05 19:41:36', '13001', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29455-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 412.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 412.00
        
                where sellbilldetailid = 524104;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13001, '2024-11-05', 290, 385, 385
                    , 412, 385, 412, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+412
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+412
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 385, 385
                    , 412, 385, 412, 385
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+385
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+385, sellCostMeanBuyPrice = sellCostMeanBuyPrice+412
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+385, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+412
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+385
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '13000';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13001', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32508;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('280','06226', '143367', '5', '14162', '1', '270', '270', '0', '', '1', '2024-11-05 19:41:36', '14162', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32508-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        
                where sellbilldetailid = 524105;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14162, '2024-11-05', 270, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '14161';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14162', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32242;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('395','06355', '143367', '5', '14519', '1', '390', '390', '0', '', '1', '2024-11-05 19:41:36', '14519', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32242-1,','1','1','0','0','390','390','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 1185.00, lastbuyprice_withDiscount = 395.00, meanbuyprice_withDiscount = 1185.00
        
                where sellbilldetailid = 524106;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14519, '2024-11-05', 390, 395, 395
                    , 1185, 395, 1185, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 390, 395, 395
                    , 1185, 395, 1185, 395
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+395
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+395, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+395, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+395
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '14518';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14519', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 19:41:36','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','0B676', '143367', '2', '11290', '1', '95', '95', '0', '', '1', '2024-11-05 19:41:36', '11290', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','95','95','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 188.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 188.00
        
                where sellbilldetailid = 524107;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11290, '2024-11-05', 95, 170, 180
                    , 188, 180, 188, 175.29
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+188
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+188
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175.29
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 95, 170, 180
                    , 188, 180, 188, 175.29
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+188
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+188
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175.29
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '11289';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11290', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32545;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','06437', '143367', '5', '14649', '1', '245', '245', '0', '', '1', '2024-11-05 19:41:36', '14649', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32545-1,','1','1','0','0','245','245','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        
                where sellbilldetailid = 524108;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14649, '2024-11-05', 245, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 245, 235, 235
                    , 235, 235, 235, 235
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, sellCostBuyPrice =sellCostBuyPrice+235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+235
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+235
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '14648';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14649', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32039;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','06353', '143367', '5', '14410', '1', '270', '270', '0', '', '1', '2024-11-05 19:41:36', '14410', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32039-1,','1','1','0','0','270','270','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 524109;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14410, '2024-11-05', 270, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 270, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '14409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14410', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30765;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','S1263', '143367', '3', '13667', '1', '110', '110', '0', '', '1', '2024-11-05 19:41:36', '13667', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30765-1,','1','1','0','0','110','110','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 311.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 311.00
        
                where sellbilldetailid = 524110;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13667, '2024-11-05', 110, 200, 200
                    , 311, 200, 311, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+110, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+311
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+311
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 110, 200, 200
                    , 311, 200, 311, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+110, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+311
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+311
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '13666';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13667', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30782;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','B1192', '143367', '2', '13470', '1', '105', '105', '0', '', '1', '2024-11-05 19:41:36', '13470', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30782-1,','1','1','0','0','105','105','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        
                where sellbilldetailid = 524111;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13470, '2024-11-05', 105, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+105, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 105, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+105, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '13469';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13470', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30195;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R2759', '143367', '1', '13536', '1', '210', '210', '0', '', '1', '2024-11-05 19:41:36', '13536', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30195-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        
                where sellbilldetailid = 524112;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13536, '2024-11-05', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '13535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13536', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30698;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('295','B1244', '143367', '2', '13804', '1', '140', '140', '0', '', '1', '2024-11-05 19:41:36', '13804', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30698-1,','1','1','0','0','140','140','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        
                where sellbilldetailid = 524113;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13804, '2024-11-05', 140, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 140, 295, 295
                    , 295, 295, 295, 295
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+295
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+295, sellCostMeanBuyPrice = sellCostMeanBuyPrice+295
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+295, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+295
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+295
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '13803';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13804', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '75', '2024-11-05 19:41:36','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 31876;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('195','R2880', '143367', '1', '14317', '1', '225', '225', '0', '', '1', '2024-11-05 19:41:36', '14317', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31876-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        
                where sellbilldetailid = 524114;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14317, '2024-11-05', 225, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 225, 195, 195
                    , 195, 195, 195, 195
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+195
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '75', storedetaildate = '2024-11-05 19:41:36' WHERE storedetailid = '14316';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14317', '1', '1', '1', '143367', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '75', '2024-11-05 19:41:36','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143367', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 19:41:36', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143367', '17', '10291', '1', '32', '32', '0', '', '1', '2024-11-05 19:41:36', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','32','32','0','','0','0.00','0','0','0','0');
UPDATE client SET  delegateid = 87 where clientid = 10291;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 3277, 3780, 3790
                    , 4712, 3790, 4712, 3770.29
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3277, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3790, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4712
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3790, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4712
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3770.29
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10291, '2024-11-05', 3277, 3780, 3790
                    , 4712, 3790, 4712, 3770.29
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3277, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3790, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4712
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3790, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4712
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3770.29
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3277, 3780, 3790
                    , 4712, 3790, 4712, 3770.29, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3277, netSellCostBuyPrice = netSellCostBuyPrice+3780
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3790
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4712
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3790
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4712
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3770.29
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a5643efd71 and sellbillId = 143367 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:11:37";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:41:37", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:41:37', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:12:50";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:42:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:42:50', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236043
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(621,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:42:50', userid = '2' WHERE clientid = '621';
UPDATE client SET  inUse = 0 where clientid = 621;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('621','313.00','313','1','ايصال تحصيل (( قبض من عميل ))','236043', '0', '2024-11-05 19:41:34', '2', 'clientPayedDeptController.php', '   ', '313', '0', null, '0', null, null,'', '-1','1','1','313','1','','844','0');
UPDATE save SET  savecurrentvalue = '245162.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('244849.50','313', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236044', '245162.5', '2024-11-05 19:42:50', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '313', '313', '2024-11-05', '2', '0', '0', '2024-11-05 19:42:50','اضافة ايصال سداد للعميل ام رودينا','1','0','0','0','236044','clientPayedDeptController.php?do=show&id=236044');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118997', '-1', '313', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '313', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118997', '-1', '313', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-313', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '621', clientdebtchangebefore = '313.000', clientdebtchangeamount = '313.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236043', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:41:34', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '313.00',discount='', reciptid='0', dailyentryid = '118997',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='313',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236044';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236043 -clientdebtchangeId = 236044
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:12:51";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:42:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:42:51', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:13:51";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:43:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:43:51', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236045
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10280,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:43:51', userid = '2' WHERE clientid = '10280';
UPDATE client SET  inUse = 0 where clientid = 10280;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10280','434.00','434','1','ايصال تحصيل (( قبض من عميل ))','236045', '0', '2024-11-05 19:42:51', '2', 'clientPayedDeptController.php', '   ', '434', '0', null, '0', null, null,'', '-1','1','1','434','1','','845','0');
UPDATE save SET  savecurrentvalue = '245596.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('245162.50','434', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236045', '245596.5', '2024-11-05 19:43:51', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '434', '434', '2024-11-05', '2', '0', '0', '2024-11-05 19:43:51','اضافة ايصال سداد للعميل يوسف اشرف 12','1','0','0','0','236045','clientPayedDeptController.php?do=show&id=236045');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118998', '-1', '434', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '434', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118998', '11187', '434', '','0');
UPDATE accountstree SET name = 'يوسف اشرف 12', customName = 'يوسف اشرف 12', customNameEn = 'يوسف اشرف 12', nameEn = 'يوسف اشرف 12', parent = '58', accountNature = '0', theValue = '-434', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-11-05 14:04:45' WHERE id = '11187';
UPDATE clientdebtchange SET clientid = '10280', clientdebtchangebefore = '434.000', clientdebtchangeamount = '434.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236045', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:42:51', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '434.00',discount='', reciptid='0', dailyentryid = '118998',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='434',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236045';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236045 -clientdebtchangeId = 236045
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:13:52";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:43:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:43:52', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:14:20";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:44:21", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 19:44:21', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13637&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:14:23";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:44:23", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:44:23', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE productunit SET unitid = '1', productid = '15872', productnumber = '1.00', productunitdate = '2024-11-05', userid = '77', conditions = '0',proUnitParcode='1587201',proUnitSellAllPrice='550',proUnitSellHalfPrice='550',proUnitSellUnitPrice ='550',proUnitBuyPrice='455',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15872';
UPDATE product SET productName = 'H1466', productDescription = '', productCatId = '14', productBuyPrice = '510', productSellAllPrice = '610', productSellUnitPrice = '610', productSellHalfPrice = '610', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1466',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455.00',lastbuyprice_withDiscount = '0',meanbuyprice = '482.5',meanbuyprice_withDiscount = '482.5' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='455',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0'  WHERE productId = '15872';
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:15:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:45:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:45:05', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a5794180d5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:36:20', '0672a5794180d5', '1', '0.00', '0', '0', '1', '190.00', '190', '190', '0', '1', '2024-11-05 19:45:05', '', '9', '0', 'نقدي', '1', '0', '3', '21', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','190','0','','0','0','190','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143368', '0', '2024-11-05 19:45:05', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '190', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 19:36:20','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','05518', '143368', '5', '11998', '1', '190', '190', '0', '', '1', '2024-11-05 19:45:05', '11998', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 309.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 309.00
        
                where sellbilldetailid = 524117;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11998, '2024-11-05', 190, 310, 310
                    , 309, 310, 309, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+309
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+309
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 310, 310
                    , 309, 310, 309, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+309
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+309
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '9', storedetaildate = '2024-11-05 19:45:05' WHERE storedetailid = '11997';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11998', '1', '1', '1', '143368', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '9', '2024-11-05 19:45:05','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '35035',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('34845','190', '0', '1', 'اضافة فاتورة مبيعات', '143368', '35035', '2024-11-05 19:45:05', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 21 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 190, 310, 310
                    , 309, 310, 309, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+309
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+309
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 310, 310
                    , 309, 310, 309, 310
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+309
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+309
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 190, 310, 310
                    , 309, 310, 309, 310, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+190, netSellCostBuyPrice = netSellCostBuyPrice+310
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+310
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+309
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+310
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+309
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+310
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a5794180d5 and sellbillId = 143368 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:15:06";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:45:06", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:45:06', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:15:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:45:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:45:14', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a5977cac98', '2024-11-05 19:44:23', '20', '244155.00', '254355', '0', '0', '10200',  '10200', '0', '10200', '1', '2024-11-05 19:45:14', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1466', '13638', '14', '15872', '20', '510', '10200', '0', '', '2024-11-05 19:45:14', '15872','','','0','0','0','0','0',null,'510','10200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:44:23', 1, 15872, 0, 0
                    , 510, 20, 0, 0, 77, '2024-11-05 19:45:14')
                ON DUPLICATE KEY UPDATE buyprice = 510,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:45:14' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15872', '510', '20', '0', 'buyBillController.php', '31424', '', '0', '0');
UPDATE product SET  productBuyPrice = "510" WHERE productId = 15872 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31424 ;
UPDATE product SET productName = 'H1466', productDescription = '', productCatId = '14', productBuyPrice = '510.00', productSellAllPrice = '610.00', productSellUnitPrice = '610.00', productSellHalfPrice = '610.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1466',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '455.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='510',meanbuyprice_withTax='510',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='510'  WHERE productId = '15872';
UPDATE buybilldetail SET  lastbuyprice = 510 , meanbuyprice = 510, lastbuyprice_withDiscount = 510, meanbuyprice_withDiscount = 510
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where buybilldetailid = 31424;
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 15872;
UPDATE storedetail SET  productquantity = '20', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15871';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15872', '1', '20', '0', '13638', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '77', '2024-11-05 19:44:23','0','0');
UPDATE supplier SET  suppliercurrentDebt = '254355',suppliercurrentDebtInCurrency= '254355' , userid = '77', supplierdate = '2024-11-05 19:45:14'   WHERE supplierid = '20';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('20', '244155.00', '10200', '0', 'اضافة فاتورة مشتريات', '13638', '254355', '2024-11-05 19:44:23', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','10200','1','244155','10200','254355','0');
update buybill set dailyentryid='0,' where buybillid=13638;
COMMIT;
UPDATE product SET overAllAveragePrice = 510 WHERE productId = 15872;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:15:14";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:45:14", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:45:14', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13638');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:15:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:45:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:45:51', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a58601c9e5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:39:44', '0672a58601c9e5', '1', '0.00', '0', '0', '1', '350.00', '350', '350', '0', '1', '2024-11-05 19:45:51', '', '9', '0', 'نقدي', '1', '0', '3', '71', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','350','0','','0','0','350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143369', '0', '2024-11-05 19:45:51', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '350', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 19:39:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34771;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','06925', '143369', '5', '15785', '1', '350', '350', '0', '', '1', '2024-11-05 19:45:51', '15785', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34771-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 524118;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15785, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '9', storedetaildate = '2024-11-05 19:45:51' WHERE storedetailid = '15784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15785', '1', '1', '1', '143369', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '9', '2024-11-05 19:45:51','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '35385',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35035','350', '0', '1', 'اضافة فاتورة مبيعات', '143369', '35385', '2024-11-05 19:45:51', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 71 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 280, 280
                    , 275, 280, 275, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,280, 270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+270
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 350, 280, 280
                    , 275, 280, 275, 270, 280, 270)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+350, netSellCostBuyPrice = netSellCostBuyPrice+280
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+280
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+275
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+280
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+275
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+270
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+280
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+270;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a58601c9e5 and sellbillId = 143369 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:15:52";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 19:45:52", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:45:52', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:16:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:46:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:46:04', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:16:09";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:16:18";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:46:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 19:46:18', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:16:19";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:16:24";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:46:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 19:46:24', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:16:38";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:46:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 19:46:38', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:16:48";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:46:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 19:46:48', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:16:56";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:46:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:46:56', '2', 'showDetail', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=139299');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:18:31";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:48:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:48:31', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:18:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:48:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-05 19:48:42', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:18:43";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 19:48:43", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:48:43', '75', 'showDetail', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143367');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:18:47";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:48:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-05 19:48:47', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:18:49";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:48:49", deviceType = "DESKTOP" WHERE userid = 2;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:18:49";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-05 19:48:49', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:48:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:48:49', '2', 'show', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:19:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:49:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-05 19:49:01', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:19:11";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:49:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:49:11', '2', 'editsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=143253');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:19:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:49:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-05 19:49:21', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:19:48";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:49:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2024-11-05 19:49:48', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/salesreport.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:20:22";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:50:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:50:22', '2', 'update', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 143253 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 143253 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143253;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 19:50:23', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '143253';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-2 where id = 29822;
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 442.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 442.00
        
                where sellbilldetailid = 523609;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13255, '2024-11-05', 790, 880, 880
                    , 884, 880, 884, 885
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-790, sellCostBuyPrice =sellCostBuyPrice-880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-880, sellCostMeanBuyPrice = sellCostMeanBuyPrice-884
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-884
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-885
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-2
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 790, 880, 880
                    , 884, 880, 884, 885
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-790, sellCostBuyPrice =sellCostBuyPrice-880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-880, sellCostMeanBuyPrice = sellCostMeanBuyPrice-884
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-884
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-885
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13254';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13255', '1', '2', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '8', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 30686;
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 523610;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13146, '2024-11-05', 235, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-235, sellCostBuyPrice =sellCostBuyPrice-330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-330, sellCostMeanBuyPrice = sellCostMeanBuyPrice-330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-235, sellCostBuyPrice =sellCostBuyPrice-330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-330, sellCostMeanBuyPrice = sellCostMeanBuyPrice-330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13145';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13146', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-2 where id = 29605;
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 523611;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13245, '2024-11-05', 330, 750, 750
                    , 750, 750, 750, 750
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-2
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 750, 750
                    , 750, 750, 750, 750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13245', '1', '2', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '5', '2', '2024-11-05 14:29:18','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 408.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 408.00
        
                where sellbilldetailid = 523612;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13147, '2024-11-05', 235, 310, 320
                    , 408, 320, 408, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-235, sellCostBuyPrice =sellCostBuyPrice-310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-408
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-408
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 310, 320
                    , 408, 320, 408, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-235, sellCostBuyPrice =sellCostBuyPrice-310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-408
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-408
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13146';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13147', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-1', '0', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 29585;
UPDATE sellbilldetail SET  lastbuyprice = 455.00 , meanbuyprice = 446.00, lastbuyprice_withDiscount = 455.00, meanbuyprice_withDiscount = 446.00
        
                where sellbilldetailid = 523613;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13115, '2024-11-05', 385, 445, 455
                    , 446, 455, 446, 443
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-385, sellCostBuyPrice =sellCostBuyPrice-445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-455, sellCostMeanBuyPrice = sellCostMeanBuyPrice-446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-443
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 445, 455
                    , 446, 455, 446, 443
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-385, sellCostBuyPrice =sellCostBuyPrice-445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-455, sellCostMeanBuyPrice = sellCostMeanBuyPrice-446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-443
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13114';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13115', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 32039;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 523614;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14410, '2024-11-05', 255, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-255, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 255, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-255, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14410', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 32044;
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 2463.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 2463.00
        
                where sellbilldetailid = 523615;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14413, '2024-11-05', 1200, 1335, 1335
                    , 7389, 1335, 7389, 1335
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1200, sellCostBuyPrice =sellCostBuyPrice-1335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1335, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7389
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7389
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-3
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1200, 1335, 1335
                    , 7389, 1335, 7389, 1335
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1200, sellCostBuyPrice =sellCostBuyPrice-1335
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1335, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7389
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1335, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7389
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1335
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14412';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14413', '1', '3', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '3', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 29514;
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 445.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 445.00
        
                where sellbilldetailid = 523616;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13171, '2024-11-05', 420, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-445, sellCostMeanBuyPrice = sellCostMeanBuyPrice-445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-445, sellCostMeanBuyPrice = sellCostMeanBuyPrice-445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '25', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13170';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13171', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '24', '25', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33035;
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 298.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 298.00
        
                where sellbilldetailid = 523617;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14543, '2024-11-05', 285, 300, 300
                    , 298, 300, 298, 297.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-285, sellCostBuyPrice =sellCostBuyPrice-300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-298
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-298
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-297.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285, 300, 300
                    , 298, 300, 298, 297.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-285, sellCostBuyPrice =sellCostBuyPrice-300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-298
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-298
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-297.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14542';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14543', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-05 14:29:18','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 523618;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10278, '2024-11-05', 770, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-770, sellCostBuyPrice =sellCostBuyPrice-1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-3
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 770, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-770, sellCostBuyPrice =sellCostBuyPrice-1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '-4', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '10277';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10278', '1', '3', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-7', '-4', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33986;
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        
                where sellbilldetailid = 523619;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14406, '2024-11-05', 135, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-135, sellCostBuyPrice =sellCostBuyPrice-145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-145, sellCostMeanBuyPrice = sellCostMeanBuyPrice-145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 135, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-135, sellCostBuyPrice =sellCostBuyPrice-145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-145, sellCostMeanBuyPrice = sellCostMeanBuyPrice-145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14406', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 32254;
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 523620;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14488, '2024-11-05', 325, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-325, sellCostBuyPrice =sellCostBuyPrice-340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-340, sellCostMeanBuyPrice = sellCostMeanBuyPrice-340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 325, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-325, sellCostBuyPrice =sellCostBuyPrice-340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-340, sellCostMeanBuyPrice = sellCostMeanBuyPrice-340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14488', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1', '2', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-2 where id = 31715;
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 561.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 561.00
        
                where sellbilldetailid = 523621;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14260, '2024-11-05', 880, 990, 990
                    , 1122, 990, 1122, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-880, sellCostBuyPrice =sellCostBuyPrice-990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-990, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1122
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1122
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-2
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 880, 990, 990
                    , 1122, 990, 1122, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-880, sellCostBuyPrice =sellCostBuyPrice-990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-990, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1122
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1122
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14259';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14260', '1', '2', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '8', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 26589;
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 486.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 486.00
        
                where sellbilldetailid = 523622;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11864, '2024-11-05', 420, 495, 495
                    , 486, 495, 486, 486.25
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-495, sellCostMeanBuyPrice = sellCostMeanBuyPrice-486
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-486
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-486.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 495, 495
                    , 486, 495, 486, 486.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-495, sellCostMeanBuyPrice = sellCostMeanBuyPrice-486
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-486
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-486.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '11863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11864', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '2', '2024-11-05 14:29:18','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 71, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 523623;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14340, '2024-11-05', 420, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-495, sellCostMeanBuyPrice = sellCostMeanBuyPrice-495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-71
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-495, sellCostMeanBuyPrice = sellCostMeanBuyPrice-495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-71
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '-7', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14340', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-8', '-7', '2', '2024-11-05 14:29:18','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 32169;
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 564.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 564.00
        
                where sellbilldetailid = 523624;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14477, '2024-11-05', 165, 175, 175
                    , 564, 175, 564, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-165, sellCostBuyPrice =sellCostBuyPrice-175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-175, sellCostMeanBuyPrice = sellCostMeanBuyPrice-564
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-564
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 175, 175
                    , 564, 175, 564, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-165, sellCostBuyPrice =sellCostBuyPrice-175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-175, sellCostMeanBuyPrice = sellCostMeanBuyPrice-564
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-564
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14476';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14477', '1', '1', '0', '143253', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1', '2', '2', '2024-11-05 14:29:18','0','0');
CALL clientInUse(8132,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '8132';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8132','7343.00','7343.00','1','تعديل فاتورة مبيعات','143253', '0', '2024-11-05 14:29:18', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '7343', '0', null, '0', null, null,'', '0','1','1','7343','1','2024-11-05 14:29:18','0','0');
UPDATE client SET  inUse = 0 where clientid = 8132;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 7343, 8755, 8775
                    , 15422, 8775, 15422, 8751.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7343, sellCostBuyPrice =sellCostBuyPrice-8755
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8775, sellCostMeanBuyPrice = sellCostMeanBuyPrice-15422
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-15422
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8751.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-71
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8132, '2024-11-05', 7343, 8755, 8775
                    , 15422, 8775, 15422, 8751.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7343, sellCostBuyPrice =sellCostBuyPrice-8755
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8775, sellCostMeanBuyPrice = sellCostMeanBuyPrice-15422
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-15422
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8751.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-71
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 7343, 8755, 8775
                    , 15422, 8775, 15422, 8751.75, 495, 71)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-7343, netSellCostBuyPrice = netSellCostBuyPrice-8755
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-8775
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-15422
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-8775
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-15422
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-8751.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-495
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-71;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 143253 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 143253 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(8132,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 14:29:18', '0672a0f9e5c836', '8132', '0.00', '6925', '0', '1', '6925', '6925', '0', '6925', '1', '2024-11-05 14:29:18', '', '2', '0', 'رحمة طارق W6', '2', '1', '3', '83', 'رحمة طارق W6', '24', '143253', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '6925', userid = '2' WHERE clientid = '8132';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8132','0.00','6925','0','اضافة فاتورة مبيعات (معدله)','143370', '6925', '2024-11-05 19:50:23', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '6925', '0', null, '0', null, null,'', '0','1','1','7343','1','2024-11-05 14:29:18','0','0');
UPDATE client SET  inUse = 0 where clientid = 8132;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 29822;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','05942', '143370', '5', '13255', '2', '395', '790', '0', '', '1', '2024-11-05 19:50:23', '13255', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29822-2,','1','1','0','0','395','790','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 442.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 442.00
        
                where sellbilldetailid = 524119;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13255, '2024-11-05', 790, 880, 880
                    , 884, 880, 884, 885
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+790, sellCostBuyPrice =sellCostBuyPrice+880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+884
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+884
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+885
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 790, 880, 880
                    , 884, 880, 884, 885
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+790, sellCostBuyPrice =sellCostBuyPrice+880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+884
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+884
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+885
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13254';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13255', '1', '2', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '6', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30686;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','05889', '143370', '5', '13146', '1', '235', '235', '0', '', '1', '2024-11-05 19:50:23', '13146', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30686-1,','1','1','0','0','235','235','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        
                where sellbilldetailid = 524120;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13146, '2024-11-05', 235, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13145';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13146', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '5', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 29605;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','05936', '143370', '5', '13245', '2', '165', '330', '0', '', '1', '2024-11-05 19:50:23', '13245', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29605-2,','1','1','0','0','165','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 524121;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13245, '2024-11-05', 330, 750, 750
                    , 750, 750, 750, 750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 750, 750
                    , 750, 750, 750, 750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13245', '1', '2', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '3', '2', '2024-11-05 19:50:23','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','05890', '143370', '5', '13147', '1', '235', '235', '0', '', '1', '2024-11-05 19:50:23', '13147', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','235','235','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 408.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 408.00
        
                where sellbilldetailid = 524122;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13147, '2024-11-05', 235, 310, 320
                    , 408, 320, 408, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+408
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+408
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 235, 310, 320
                    , 408, 320, 408, 315
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+235, sellCostBuyPrice =sellCostBuyPrice+310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+408
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+408
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+315
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13146';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13147', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '0', '-1', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29585;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('455','05872', '143370', '5', '13115', '1', '385', '385', '0', '', '1', '2024-11-05 19:50:23', '13115', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29585-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 455.00 , meanbuyprice = 446.00, lastbuyprice_withDiscount = 455.00, meanbuyprice_withDiscount = 446.00
        
                where sellbilldetailid = 524123;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13115, '2024-11-05', 385, 445, 455
                    , 446, 455, 446, 443
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+443
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385, 445, 455
                    , 446, 455, 446, 443
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+443
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13114';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13115', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32039;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','06353', '143370', '5', '14410', '1', '255', '255', '0', '', '1', '2024-11-05 19:50:23', '14410', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32039-1,','1','1','0','0','255','255','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 524124;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14410, '2024-11-05', 255, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 255, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14410', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 32044;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('445','06350', '143370', '5', '14413', '2', '500', '1000', '0', '', '1', '2024-11-05 19:50:23', '14413', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32044-2,','1','1','0','0','500','1000','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 2463.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 2463.00
        
                where sellbilldetailid = 524125;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14413, '2024-11-05', 1000, 890, 890
                    , 4926, 890, 4926, 890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+890
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+890, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4926
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4926
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1000, 890, 890
                    , 4926, 890, 4926, 890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+890
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+890, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4926
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4926
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14412';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14413', '1', '2', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '1', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29514;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('445','05904', '143370', '5', '13171', '1', '420', '420', '0', '', '1', '2024-11-05 19:50:23', '13171', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','29514-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 445.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 445.00
        
                where sellbilldetailid = 524126;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13171, '2024-11-05', 420, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 445, 445
                    , 445, 445, 445, 445
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+445, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+445
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+445
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '13170';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13171', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '24', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33035;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','06396', '143370', '5', '14543', '1', '285', '285', '0', '', '1', '2024-11-05 19:50:23', '14543', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33035-1,','1','1','0','0','285','285','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 298.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 298.00
        
                where sellbilldetailid = 524127;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14543, '2024-11-05', 285, 300, 300
                    , 298, 300, 298, 297.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+298
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+298
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+297.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 285, 300, 300
                    , 298, 300, 298, 297.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+298
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+298
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+297.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14542';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14543', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '5', '2', '2024-11-05 19:50:23','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','10361', '143370', '5', '10278', '3', '185', '555', '0', '', '1', '2024-11-05 19:50:23', '10278', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','185','555','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        
                where sellbilldetailid = 524128;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10278, '2024-11-05', 555, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+555, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 555, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+555, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-7', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '10277';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10278', '1', '3', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '-4', '-7', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33986;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06340', '143370', '5', '14406', '1', '135', '135', '0', '', '1', '2024-11-05 19:50:23', '14406', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33986-1,','1','1','0','0','135','135','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        
                where sellbilldetailid = 524129;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14406, '2024-11-05', 135, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 135, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+145, sellCostMeanBuyPrice = sellCostMeanBuyPrice+145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14406', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32254;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','06352', '143370', '5', '14488', '1', '325', '325', '0', '', '1', '2024-11-05 19:50:23', '14488', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32254-1,','1','1','0','0','325','325','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        
                where sellbilldetailid = 524130;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14488, '2024-11-05', 325, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 325, 340, 340
                    , 340, 340, 340, 340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14488', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2', '1', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 31715;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06271', '143370', '5', '14260', '2', '440', '880', '0', '', '1', '2024-11-05 19:50:23', '14260', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','31715-2,','1','1','0','0','440','880','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 561.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 561.00
        
                where sellbilldetailid = 524131;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14260, '2024-11-05', 880, 990, 990
                    , 1122, 990, 1122, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+880, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1122
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1122
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 880, 990, 990
                    , 1122, 990, 1122, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+880, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1122
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1122
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14259';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14260', '1', '2', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '6', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 26589;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','05449', '143370', '5', '11864', '1', '420', '420', '0', '', '1', '2024-11-05 19:50:23', '11864', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','26589-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 486.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 486.00
        
                where sellbilldetailid = 524132;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11864, '2024-11-05', 420, 495, 495
                    , 486, 495, 486, 486.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+486
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+486
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+486.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 495, 495
                    , 486, 495, 486, 486.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+486
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+486
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+486.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '11863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11864', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '2', '2024-11-05 19:50:23','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','06307', '143370', '5', '14340', '1', '420', '420', '0', '', '1', '2024-11-05 19:50:23', '14340', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','420','420','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 71, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 524133;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14340, '2024-11-05', 420, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+71
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 420, 495, 495
                    , 495, 495, 495, 495
                    , 0, 0, 0, 0
                    , 0, 0, 0, 495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+495, sellCostMeanBuyPrice = sellCostMeanBuyPrice+495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+495
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+71
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-8', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14340', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '-7', '-8', '2', '2024-11-05 19:50:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 32169;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','06382', '143370', '5', '14477', '1', '165', '165', '0', '', '1', '2024-11-05 19:50:23', '14477', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','32169-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 564.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 564.00
        
                where sellbilldetailid = 524134;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14477, '2024-11-05', 165, 175, 175
                    , 564, 175, 564, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+564
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+564
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 165, 175, 175
                    , 564, 175, 564, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+564
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+564
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 19:50:23' WHERE storedetailid = '14476';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14477', '1', '1', '1', '143370', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2', '1', '2', '2024-11-05 19:50:23','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143370', '9', '2015', '1', '20', '20', '0', '', '1', '2024-11-05 19:50:24', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143370', '17', '10291', '1', '70', '70', '0', '', '1', '2024-11-05 19:50:24', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','1','1','0','0','70','70','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 6925, 8310, 8330
                    , 12959, 8330, 12959, 8306.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6925, sellCostBuyPrice =sellCostBuyPrice+8310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12959
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12959
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8306.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+71
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8132, '2024-11-05', 6925, 8310, 8330
                    , 12959, 8330, 12959, 8306.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,495, 71, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6925, sellCostBuyPrice =sellCostBuyPrice+8310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12959
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12959
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8306.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+495
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+71
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 6925, 8310, 8330
                    , 12959, 8330, 12959, 8306.75, 495, 71)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6925, netSellCostBuyPrice = netSellCostBuyPrice+8310
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8330
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+12959
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8330
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+12959
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8306.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+495
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+71;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 143253 and newid=143370 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:20:24";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:50:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:50:24', '2', 'editprint', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143370');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:21:19";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:51:19", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 19:51:19', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13638&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:21:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:51:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:51:21', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:21:42";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:51:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:51:42', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:22:12";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:52:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:52:12', '2', 'addsellBill', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:23:39";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:53:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:53:39', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236050
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9991,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-200' , clientdate = '2024-11-05 19:53:39', userid = '2' WHERE clientid = '9991';
UPDATE client SET  inUse = 0 where clientid = 9991;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9991','0.00','200','1','ايصال تحصيل (( قبض من عميل ))','236050', '-200', '2024-11-05 19:51:42', '2', 'clientPayedDeptController.php', '   ', '200', '0', null, '0', null, null,'', '-1','1','1','200','1','','846','0');
UPDATE save SET  savecurrentvalue = '245796.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('245596.50','200', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236050', '245796.5', '2024-11-05 19:53:39', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نهال الحفناوي 99', 'نهال الحفناوي 99', 'نهال الحفناوي 99', 'نهال الحفناوي 99', '58', '0', '-200.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:53:39');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '200', '200', '2024-11-05', '2', '0', '0', '2024-11-05 19:53:39','اضافة ايصال سداد للعميل نهال الحفناوي 99','1','0','0','0','236050','clientPayedDeptController.php?do=show&id=236050');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118999', '-1', '200', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '200', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('118999', '11241', '200', '','0');
UPDATE accountstree SET name = 'نهال الحفناوي 99', customName = 'نهال الحفناوي 99', customNameEn = 'نهال الحفناوي 99', nameEn = 'نهال الحفناوي 99', parent = '58', accountNature = '0', theValue = '-400', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:53:39' WHERE id = '11241';
UPDATE clientdebtchange SET clientid = '9991', clientdebtchangebefore = '0.000', clientdebtchangeamount = '200.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236050', clientdebtchangeafter = '-200.000', clientdebtchangedate = '2024-11-05 19:51:42', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '200.00',discount='', reciptid='0', dailyentryid = '118999',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='200',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236050';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236050 -clientdebtchangeId = 236050
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:23:40";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:53:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:53:40', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:23:57";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:53:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:53:57', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236051
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10033,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-300' , clientdate = '2024-11-05 19:53:57', userid = '2' WHERE clientid = '10033';
UPDATE client SET  inUse = 0 where clientid = 10033;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10033','0.00','300','1','ايصال تحصيل (( قبض من عميل ))','236051', '-300', '2024-11-05 19:53:40', '2', 'clientPayedDeptController.php', '   ', '300', '0', null, '0', null, null,'', '-1','1','1','300','1','','847','0');
UPDATE save SET  savecurrentvalue = '246096.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('245796.50','300', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236051', '246096.5', '2024-11-05 19:53:57', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('دنيا الصف 56', 'دنيا الصف 56', 'دنيا الصف 56', 'دنيا الصف 56', '58', '0', '-300.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 19:53:57');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '300', '300', '2024-11-05', '2', '0', '0', '2024-11-05 19:53:57','اضافة ايصال سداد للعميل دنيا الصف 56','1','0','0','0','236051','clientPayedDeptController.php?do=show&id=236051');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119000', '-1', '300', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '300', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119000', '11242', '300', '','0');
UPDATE accountstree SET name = 'دنيا الصف 56', customName = 'دنيا الصف 56', customNameEn = 'دنيا الصف 56', nameEn = 'دنيا الصف 56', parent = '58', accountNature = '0', theValue = '-600', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 19:53:57' WHERE id = '11242';
UPDATE clientdebtchange SET clientid = '10033', clientdebtchangebefore = '0.000', clientdebtchangeamount = '300.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236051', clientdebtchangeafter = '-300.000', clientdebtchangedate = '2024-11-05 19:53:40', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '300.00',discount='', reciptid='0', dailyentryid = '119000',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='300',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236051';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236051 -clientdebtchangeId = 236051
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:23:58";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:53:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:53:58', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:24:17";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:54:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:54:17', '2', 'add', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236052
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1551,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 19:54:17', userid = '2' WHERE clientid = '1551';
UPDATE client SET  inUse = 0 where clientid = 1551;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1551','364.00','364','1','ايصال تحصيل (( قبض من عميل ))','236052', '0', '2024-11-05 19:53:58', '2', 'clientPayedDeptController.php', '   ', '364', '0', null, '0', null, null,'', '-1','1','1','364','1','','848','0');
UPDATE save SET  savecurrentvalue = '246460.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('246096.50','364', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236052', '246460.5', '2024-11-05 19:54:17', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '364', '364', '2024-11-05', '2', '0', '0', '2024-11-05 19:54:17','اضافة ايصال سداد للعميل ام ملك الاسماعلية d1','1','0','0','0','236052','clientPayedDeptController.php?do=show&id=236052');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119001', '-1', '364', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '364', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119001', '-1', '364', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-364', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '1551', clientdebtchangebefore = '364.000', clientdebtchangeamount = '364.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236052', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 19:53:58', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '364.00',discount='', reciptid='0', dailyentryid = '119001',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='364',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236052';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236052 -clientdebtchangeId = 236052
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:24:18";
UPDATE user SET loginip = "192.168.1.6", lastactivetime = "2024-11-05 19:54:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 19:54:18', '2', '', '192.168.1.6', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:25:03";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:55:03", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:55:03', '77', 'bill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=bill&billnameid=1');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:25:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:55:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 19:55:09', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:25:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 19:55:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 19:55:17', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE productunit SET unitid = '1', productid = '15838', productnumber = '1.00', productunitdate = '2024-11-02', userid = '77', conditions = '0',proUnitParcode='1583801',proUnitSellAllPrice='430',proUnitSellHalfPrice='430',proUnitSellUnitPrice ='430',proUnitBuyPrice='350',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0' WHERE productunitid = '15838';
UPDATE product SET productName = 'H1455', productDescription = '', productCatId = '14', productBuyPrice = '320', productSellAllPrice = '430', productSellUnitPrice = '430', productSellHalfPrice = '430', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1455',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350.00',lastbuyprice_withDiscount = '350',meanbuyprice = '335',meanbuyprice_withDiscount = '335' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='350'  WHERE productId = '15838';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1467','','14','480','640', '640','640', '2024-11-05', '0', '77', '1', 'H1467', '0', '0', '0', '0', '0', '480','480','480','480','480','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','480','480','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15880, 1,'2024-11-05 19:56:47',77)
                ON DUPLICATE KEY UPDATE productid = 15880, edited = 1, sysdate = '2024-11-05 19:56:47', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15880', '1', '2024-11-05', '77', '0','1588001','640','640','640','480','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15880', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15880', '1', '0', '0', '15880', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax) VALUES ('H1468','','14','320','400', '400','400', '2024-11-05', '0', '77', '1', 'H1468', '0', '0', '0', '0', '0', '320','320','320','320','320','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','0','0','0','0','','0','0','','0','','320','320','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (15881, 1,'2024-11-05 19:57:26',77)
                ON DUPLICATE KEY UPDATE productid = 15881, edited = 1, sysdate = '2024-11-05 19:57:26', userid = 77;
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8) VALUES ('1', '15881', '1', '2024-11-05', '77', '0','1588101','400','400','400','320','','0','0','0','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('15881', '1', '0', '77', '2024-11-05');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15881', '1', '0', '0', '15881', 'إضافة منتج', 'productController.php', '0', '0', '77', '2024-11-05','0','0');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:27:38";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:57:38", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:57:38', '77', 'add', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=add');
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId) VALUES ('0672a5bf732ca7', '2024-11-05 19:55:03', '10', '94765.00', '106115', '0', '0', '11350',  '11350', '0', '11350', '1', '2024-11-05 19:57:38', '', '77', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1455', '13639', '14', '15838', '10', '320', '3200', '0', '', '2024-11-05 19:57:38', '15838','','','0','0','0','0','0',null,'320','3200','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:55:03', 1, 15838, 0, 0
                    , 320, 10, 0, 0, 77, '2024-11-05 19:57:38')
                ON DUPLICATE KEY UPDATE buyprice = 320,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:57:38' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15838', '320', '10', '0', 'buyBillController.php', '31425', '', '0', '0');
UPDATE product SET  productBuyPrice = "320" WHERE productId = 15838 ;
UPDATE buybilldetail SET  quantitybefore = 2 WHERE buybilldetailid = 31425 ;
UPDATE product SET productName = 'H1455', productDescription = '', productCatId = '14', productBuyPrice = '320.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1455',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '323',meanbuyprice_withDiscount = '323' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='320',meanbuyprice_withTax='325',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='320'  WHERE productId = '15838';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 323, lastbuyprice_withDiscount = 320, meanbuyprice_withDiscount = 323
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 320
                where buybilldetailid = 31425;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 15838;
UPDATE storedetail SET  productquantity = '12', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15837';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15838', '1', '10', '0', '13639', 'اضافة فاتورة مشتريات', 'buyBillController.php', '2', '12', '77', '2024-11-05 19:55:03','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1467', '13639', '14', '15880', '10', '480', '4800', '0', '', '2024-11-05 19:57:38', '15880','','','0','0','0','0','0',null,'480','4800','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:55:03', 1, 15880, 0, 0
                    , 480, 10, 0, 0, 77, '2024-11-05 19:57:38')
                ON DUPLICATE KEY UPDATE buyprice = 480,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:57:38' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15880', '480', '10', '0', 'buyBillController.php', '31426', '', '0', '0');
UPDATE product SET  productBuyPrice = "480" WHERE productId = 15880 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31426 ;
UPDATE product SET productName = 'H1467', productDescription = '', productCatId = '14', productBuyPrice = '480.00', productSellAllPrice = '640.00', productSellUnitPrice = '640.00', productSellHalfPrice = '640.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1467',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='480',meanbuyprice_withTax='480',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='480'  WHERE productId = '15880';
UPDATE buybilldetail SET  lastbuyprice = 480 , meanbuyprice = 480, lastbuyprice_withDiscount = 480, meanbuyprice_withDiscount = 480
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 480
                where buybilldetailid = 31426;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 15880;
UPDATE storedetail SET  productquantity = '10', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15879';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15880', '1', '10', '0', '13639', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '10', '77', '2024-11-05 19:55:03','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1454', '13639', '14', '15837', '5', '350', '1750', '0', '', '2024-11-05 19:57:38', '15837','','','0','0','0','0','0',null,'350','1750','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:55:03', 1, 15837, 0, 0
                    , 350, 5, 0, 0, 77, '2024-11-05 19:57:38')
                ON DUPLICATE KEY UPDATE buyprice = 350,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:57:38' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15837', '350', '5', '0', 'buyBillController.php', '31427', '', '0', '0');
UPDATE product SET  productBuyPrice = "350" WHERE productId = 15837 ;
UPDATE buybilldetail SET  quantitybefore = 4 WHERE buybilldetailid = 31427 ;
UPDATE product SET productName = 'H1454', productDescription = '', productCatId = '14', productBuyPrice = '350.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2024-11-02', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1454',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='350'  WHERE productId = '15837';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where buybilldetailid = 31427;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 15837;
UPDATE storedetail SET  productquantity = '9', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15836';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15837', '1', '5', '0', '13639', 'اضافة فاتورة مشتريات', 'buyBillController.php', '4', '9', '77', '2024-11-05 19:55:03','0','0');
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax) VALUES ('H1468', '13639', '14', '15881', '5', '320', '1600', '0', '', '2024-11-05 19:57:38', '15881','','','0','0','0','0','0',null,'320','1600','0','0','0','0','0','0','0','0');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-11-05 19:55:03', 1, 15881, 0, 0
                    , 320, 5, 0, 0, 77, '2024-11-05 19:57:38')
                ON DUPLICATE KEY UPDATE buyprice = 320,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 77,sysDate = '2024-11-05 19:57:38' ;
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15881', '320', '5', '0', 'buyBillController.php', '31428', '', '0', '0');
UPDATE product SET  productBuyPrice = "320" WHERE productId = 15881 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31428 ;
UPDATE product SET productName = 'H1468', productDescription = '', productCatId = '14', productBuyPrice = '320.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2024-11-05', conditions = '0', userId = '77', limitamount = '1', parcode = 'H1468',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='320',meanbuyprice_withTax='320',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='320'  WHERE productId = '15881';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 320, meanbuyprice_withDiscount = 320
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where buybilldetailid = 31428;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 15881;
UPDATE storedetail SET  productquantity = '5', userid = '77', storedetaildate = '2024-11-05' WHERE storedetailid = '15880';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15881', '1', '5', '0', '13639', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '5', '77', '2024-11-05 19:55:03','0','0');
UPDATE supplier SET  suppliercurrentDebt = '106115',suppliercurrentDebtInCurrency= '106115' , userid = '77', supplierdate = '2024-11-05 19:57:38'   WHERE supplierid = '10';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo) VALUES ('10', '94765.00', '11350', '0', 'اضافة فاتورة مشتريات', '13639', '106115', '2024-11-05 19:55:03', '77', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','11350','1','94765','11350','106115','0');
update buybill set dailyentryid='0,' where buybillid=13639;
COMMIT;
UPDATE product SET overAllAveragePrice = 350 WHERE productId = 15837;UPDATE product SET overAllAveragePrice = 330 WHERE productId = 15838;UPDATE product SET overAllAveragePrice = 480 WHERE productId = 15880;UPDATE product SET overAllAveragePrice = 320 WHERE productId = 15881;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:27:39";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:57:39", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2024-11-05 19:57:39', '77', 'editprint', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/buyBillController.php?do=editprint&id=13639');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:27:46";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:57:46", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 19:57:46', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13639&type=2');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:29:11";
UPDATE user SET loginip = "192.168.1.5", lastactivetime = "2024-11-05 19:59:11", deviceType = "DESKTOP" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2024-11-05 19:59:11', '77', 'showbarcodebuybill', '192.168.1.5', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13639&type=2');
UPDATE user SET loginip = "" WHERE userid = 77;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:30:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:00:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 20:00:55', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:31:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:01:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 20:01:16', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236053
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10288,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 20:01:16', userid = '2' WHERE clientid = '10288';
UPDATE client SET  inUse = 0 where clientid = 10288;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10288','323.00','323','1','ايصال تحصيل (( قبض من عميل ))','236053', '0', '2024-11-05 20:00:56', '2', 'clientPayedDeptController.php', '   ', '323', '0', null, '0', null, null,'', '-1','1','1','323','1','','849','0');
UPDATE save SET  savecurrentvalue = '246783.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('246460.50','323', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236053', '246783.5', '2024-11-05 20:01:16', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '323', '323', '2024-11-05', '2', '0', '0', '2024-11-05 20:01:16','اضافة ايصال سداد للعميل جينا سعد 41','1','0','0','0','236053','clientPayedDeptController.php?do=show&id=236053');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119002', '-1', '323', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '323', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119002', '11223', '323', '','0');
UPDATE accountstree SET name = 'جينا سعد 41', customName = 'جينا سعد 41', customNameEn = 'جينا سعد 41', nameEn = 'جينا سعد 41', parent = '58', accountNature = '0', theValue = '-323', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '75', del = '0', sysdate = '2024-11-05 17:46:12' WHERE id = '11223';
UPDATE clientdebtchange SET clientid = '10288', clientdebtchangebefore = '323.000', clientdebtchangeamount = '323.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236053', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 20:00:56', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '323.00',discount='', reciptid='0', dailyentryid = '119002',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='323',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236053';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236053 -clientdebtchangeId = 236053
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:31:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:01:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 20:01:17', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:31:38";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:01:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 20:01:38', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:37:27";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:07:27", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:07:27', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a59d047cb8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 19:45:52', '0672a59d047cb8', '1', '0.00', '0', '0', '1', '550.00', '550', '550', '0', '1', '2024-11-05 20:07:27', '', '9', '0', 'نقدي', '1', '0', '3', '74', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','550','0','','0','0','550','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143371', '0', '2024-11-05 20:07:27', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '550', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 19:45:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34488;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('490','H1380', '143371', '14', '15623', '1', '550', '550', '0', '', '1', '2024-11-05 20:07:27', '15623', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34488-1,','1','1','0','0','550','550','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 524137;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15623, '2024-11-05', 550, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '9', storedetaildate = '2024-11-05 20:07:27' WHERE storedetailid = '15622';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15623', '1', '1', '1', '143371', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '9', '2024-11-05 20:07:27','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '35935',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35385','550', '0', '1', 'اضافة فاتورة مبيعات', '143371', '35935', '2024-11-05 20:07:27', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 74 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 550, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 550, 490, 490
                    , 490, 490, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,490, 490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+550, sellCostBuyPrice =sellCostBuyPrice+490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 550, 490, 490
                    , 490, 490, 490, 490, 490, 490)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+550, netSellCostBuyPrice = netSellCostBuyPrice+490
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+490
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+490
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+490
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+490
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+490
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+490
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+490;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a59d047cb8 and sellbillId = 143371 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:37:28";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:07:28", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:07:28', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:38:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:08:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 20:08:05', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:38:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:08:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 20:08:17', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '55', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '35880',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35935.00','55', '1', '1', 'إضافة مصروف', '24297', '35880', '2024-11-05 20:08:17', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '55.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24297';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:38:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:08:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 20:08:17', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:38:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:08:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 20:08:19', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:38:25";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:08:25", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:08:25', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:40:20";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:10:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 20:10:20', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:40:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:10:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 20:10:31', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:41:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:11:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:11:19', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a5f19d2b47
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 20:08:25', '0672a5f19d2b47', '1', '0.00', '0', '0', '1', '780.00', '780', '780', '0', '1', '2024-11-05 20:11:20', '', '9', '0', 'نقدي', '1', '0', '3', '92', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','780','0','','0','0','780','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143372', '0', '2024-11-05 20:11:20', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '780', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 20:08:25','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34822;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('145','06934', '143372', '5', '15820', '2', '200', '400', '0', '', '1', '2024-11-05 20:11:20', '15820', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34822-2,','1','1','0','0','200','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 141, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 524138;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15820, '2024-11-05', 400, 280, 280
                    , 282, 280, 282, 283.34
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 280, 280
                    , 282, 280, 282, 283.34
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 282, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+282
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+282
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+282
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '40', userid = '9', storedetaildate = '2024-11-05 20:11:20' WHERE storedetailid = '15819';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15820', '1', '2', '1', '143372', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '40', '9', '2024-11-05 20:11:20','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34677;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06864', '143372', '5', '15647', '2', '190', '380', '0', '', '1', '2024-11-05 20:11:20', '15647', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34677-2,','1','1','0','0','190','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 524139;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15647, '2024-11-05', 380, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 280, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 280, 280
                    , 280, 280, 280, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 280, 280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '9', storedetaildate = '2024-11-05 20:11:20' WHERE storedetailid = '15646';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15647', '1', '2', '1', '143372', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '10', '9', '2024-11-05 20:11:20','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '36660',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('35880','780', '0', '1', 'اضافة فاتورة مبيعات', '143372', '36660', '2024-11-05 20:11:20', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 92 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 780, 560, 560
                    , 562, 560, 562, 563.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,560, 562, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+780, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+562
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+562
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+563.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+562
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 780, 560, 560
                    , 562, 560, 562, 563.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,560, 562, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+780, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+562
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+562
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+563.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+562
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 780, 560, 560
                    , 562, 560, 562, 563.34, 560, 562)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+780, netSellCostBuyPrice = netSellCostBuyPrice+560
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+560
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+562
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+560
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+562
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+563.34
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+560
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+562;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a5f19d2b47 and sellbillId = 143372 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:41:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:11:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:11:20', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:54:00";
UPDATE user SET loginip = "197.52.54.121", lastactivetime = "2024-11-05 20:24:01", deviceType = "MOBILE" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2024-11-05 20:24:01', '77', '', '197.52.54.121', '', 'MOBILE','https://41.131.49.210/~newweb/erp/controllers/index.php');
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
DROP PROCEDURE IF EXISTS generateParcodes;;

    create procedure generateParcodes (in num int)
    begin
        declare numLen int default CHAR_LENGTH(num);
        declare i int default 0;

        ALTER TABLE availableparcode ENGINE = MyISAM;

        while i <= num do
        insert into availableparcode (value) values (lpad(i, numLen, 0));
        set i = i + 1;
        end while;

        ALTER TABLE availableparcode ENGINE = InnoDB;
    end

;
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM client WHERE clientid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update client set inUse=1 where clientid = id;
        SELECT clientdebt,clientname,treeId INTO debtis,nameis,treeIdis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use","in_use" INTO debtis,nameis,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS saveInUse;;

CREATE PROCEDURE saveInUse(IN id INT, OUT saveidis INT, OUT savecurrentvalueis FLOAT, OUT currencyIdis INT, OUT treeIdis INT, OUT conversionFactoris FLOAT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM save WHERE saveid = id INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE save SET inUse = 1 WHERE saveid = id;
    SELECT saveid, savecurrentvalue, currencyId, treeId, currency.conversionFactor INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris
    FROM save
    LEFT JOIN currency ON currency.id = save.currencyId
    WHERE saveid = id;
  ELSE
    SELECT -10, -10, -10, -10, -10 INTO saveidis, savecurrentvalueis, currencyIdis, treeIdis, conversionFactoris;
  END IF;
END


;
DROP PROCEDURE IF EXISTS insertUniqueOptNum;;

CREATE PROCEDURE insertUniqueOptNum(IN optnum INT,IN storeidfrom INT,IN storeidto INT,IN productid INT,IN transferproductamount decimal(10,2),IN transferproductdate DATE,IN userid INT,IN conditions INT,IN `comment` TEXT,IN `maincomment` TEXT,IN deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,IN storetype INT,IN expireDate Text,IN priceType TEXT,IN recieveType INT,OUT inserted_id INT,OUT optnum_used INT)
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE id INT DEFAULT 0;
DECLARE lastopt INT DEFAULT 0;


DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
    ROLLBACK;
    GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,
     @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
    SET @full_error = CONCAT("ERROR ", @errno, " (", @sqlstate, "): ", @text);
    SELECT @full_error;
    ROLLBACK;
END;



START TRANSACTION;


SELECT COUNT(*) FROM storemovement WHERE `operationnum` = optnum INTO n;
SELECT DISTINCT operationnum FROM storemovement WHERE operationnum != 0  ORDER BY operationnum DESC limit 1 INTO lastopt;
set lastopt = lastopt+1;

	IF n > 0 THEN


      INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment,maincomment,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,maincomment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment,maincomment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,expireDate,priceType,recieveType);
            SELECT LAST_INSERT_ID(),optnum INTO inserted_id,optnum_used;
	END IF;

COMMIT WORK; -- it is mandatory dont wait comit in php.as if sp didnot found comit before reaching the end it will rollback giving no errors at all

End;
;;

;
DROP PROCEDURE IF EXISTS supplierInUse;;

CREATE PROCEDURE supplierInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis VARCHAR(256),OUT dailyid INT,OUT treeIdis VARCHAR(256))
BEGIN
DECLARE in_use_flag INT DEFAULT 1;
SELECT inUse FROM supplier WHERE supplierid = id INTO in_use_flag;

    IF in_use_flag = 0 THEN
        update supplier set inUse=1 where supplierid = id;
        SELECT suppliercurrentDebt,suppliername,dailyentryid,treeId INTO debtis,nameis,dailyid,treeIdis FROM supplier WHERE supplierid = id ;
    ELSE
        SELECT "in_use","in_use","in_use","in_use" INTO debtis,nameis,dailyid,treeIdis;
    END IF;

END

;
DROP PROCEDURE IF EXISTS storedetailInUse;;

CREATE PROCEDURE storedetailInUse(IN productidin INT,IN storeidin INT,IN unittypein INT,
OUT storedetailidis INT, OUT productidis INT, OUT storeidis INT, OUT productquantityis decimal(10,2), OUT useridis INT, OUT storedetaildateis DATE, OUT unittypeis INT)
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM storedetail WHERE productid = productidin and storeid=storeidin and unittype=unittypein INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE storedetail SET inUse = 1 WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
    SELECT storedetailid, productid, storeid, productquantity, userid,storedetaildate,unittype
        INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis
    FROM storedetail
    WHERE productid = productidin and storeid=storeidin and unittype=unittypein;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10 INTO storedetailidis, productidis, storeidis, productquantityis, useridis,storedetaildateis,unittypeis;
  END IF;
END


;
DROP PROCEDURE IF EXISTS sizeColorStoredetailInUseSP;;

CREATE PROCEDURE sizeColorStoredetailInUseSP(IN idin INT,OUT idis INT, OUT storeidis INT, OUT productidis INT, OUT sizeidis INT,OUT coloridis INT,OUT parcodeis VARCHAR(300),
OUT buypriceis decimal(10,2),OUT sellunitpriceis decimal(10,2) ,OUT quantityis decimal(10,2), OUT useridis INT, OUT sysdateis DATE, OUT scdExcelParcodeis VARCHAR(12))
BEGIN
  DECLARE in_use_flag INT DEFAULT 1;
  SELECT inUse FROM sizecolorstoredetail WHERE id = idin INTO in_use_flag;

  IF in_use_flag = 0 THEN
    UPDATE sizecolorstoredetail SET inUse = 1 WHERE id = idin;
    SELECT id,storeid,productid,sizeid,colorid,parcode,buyprice,sellunitprice,quantity,userid,sysdate,scdExcelParcode
        INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis
    FROM sizecolorstoredetail
    WHERE id = idin;
  ELSE
    SELECT -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 INTO idis, storeidis, productidis,sizeidis,coloridis,parcodeis,buypriceis,sellunitpriceis,quantityis,useridis,sysdateis,scdExcelParcodeis;
  END IF;
END


;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:54:02";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:54:19";
UPDATE user SET loginip = "197.52.54.121", lastactivetime = "2024-11-05 20:24:19", deviceType = "MOBILE" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 20:24:19', '77', 'oneSupplier', '197.52.54.121', '', 'MOBILE','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:54:24";
UPDATE user SET loginip = "197.52.54.121", lastactivetime = "2024-11-05 20:24:24", deviceType = "MOBILE" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 20:24:24', '77', '', '197.52.54.121', '', 'MOBILE','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:54:26";
UPDATE user SET loginip = "197.52.54.121", lastactivetime = "2024-11-05 20:24:26", deviceType = "MOBILE" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 20:24:26', '77', '', '197.52.54.121', '', 'MOBILE','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:54:33";
UPDATE user SET loginip = "197.52.54.121", lastactivetime = "2024-11-05 20:24:33", deviceType = "MOBILE" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 20:24:33', '77', 'oneSupplier', '197.52.54.121', '', 'MOBILE','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 16:54:43";
UPDATE user SET loginip = "197.52.54.121", lastactivetime = "2024-11-05 20:24:43", deviceType = "MOBILE" WHERE userid = 77;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2024-11-05 20:24:43', '77', 'oneSupplier', '197.52.54.121', '', 'MOBILE','https://41.131.49.210/~newweb/erp/controllers/supplierReportsController.php?do=oneSupplier');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:10:22";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 20:40:22", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:40:22', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:14:38";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:44:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-05 20:44:38', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:14:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:44:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-05 20:44:39', '2', 'showallajax', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:15:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:45:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-05 20:45:08', '2', 'showallajax', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:15:13";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:45:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-05 20:45:13', '2', 'showallajax', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:15:19";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:45:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2024-11-05 20:45:19', '2', 'showallajax', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientdebt.php?do=showallajax');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:15:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:45:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:45:40', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:18:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:48:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:48:10', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a67d453994
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 20:45:40', '0672a67d453994', '1', '0.00', '0', '0', '1', '250.00', '250', '250', '0', '1', '2024-11-05 20:48:10', '', '9', '0', 'نقدي', '1', '0', '3', '54', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','250','0','','0','0','250','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143373', '0', '2024-11-05 20:48:10', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '250', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 20:45:40','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 24954;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0K657', '143373', '7', '11378', '1', '250', '250', '0', '', '1', '2024-11-05 20:48:10', '11378', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','24954-1,','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where sellbilldetailid = 524140;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11378, '2024-11-05', 250, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 250, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 20:48:10' WHERE storedetailid = '11377';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11378', '1', '1', '1', '143373', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 20:48:10','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '36910',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36660','250', '0', '1', 'اضافة فاتورة مبيعات', '143373', '36910', '2024-11-05 20:48:10', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 54 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 250, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 250, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 250, 210, 210
                    , 210, 210, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+250, netSellCostBuyPrice = netSellCostBuyPrice+210
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+210
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+210
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+210
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+210
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+210
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a67d453994 and sellbillId = 143373 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:18:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 20:48:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 20:48:11', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:19:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:49:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 20:49:43', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:20:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:50:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 20:50:14', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:21:03";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:51:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 20:51:03', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236057
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10256,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 20:51:03', userid = '2' WHERE clientid = '10256';
UPDATE client SET  inUse = 0 where clientid = 10256;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('10256','4720.00','4720','1','ايصال تحصيل (( قبض من عميل ))','236057', '0', '2024-11-05 20:50:14', '2', 'clientPayedDeptController.php', '   ', '4720', '0', null, '0', null, null,'', '-1','1','1','4720','1','','850','0');
UPDATE save SET  savecurrentvalue = '251503.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('246783.50','4720', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236057', '251503.5', '2024-11-05 20:51:03', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4720', '4720', '2024-11-05', '2', '0', '0', '2024-11-05 20:51:03','اضافة ايصال سداد للعميل mohamed joya','1','0','0','0','236057','clientPayedDeptController.php?do=show&id=236057');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119003', '-1', '4720', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '4720', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119003', '11067', '4720', '','0');
UPDATE accountstree SET name = 'mohamed joya', customName = 'mohamed joya', customNameEn = 'mohamed joya', nameEn = 'mohamed joya', parent = '58', accountNature = '0', theValue = '-4720', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '9', del = '0', sysdate = '2024-11-01 20:01:59' WHERE id = '11067';
UPDATE clientdebtchange SET clientid = '10256', clientdebtchangebefore = '4720.000', clientdebtchangeamount = '4720.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236057', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 20:50:14', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '4720.00',discount='', reciptid='0', dailyentryid = '119003',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='4720',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236057';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236057 -clientdebtchangeId = 236057
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:21:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 20:51:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 20:51:04', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:31:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:01:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 21:01:09', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:32:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:02:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:02:21', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:32:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:02:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:02:35', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'محمد عبدة', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '36860',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36910.00','50', '1', '1', 'إضافة مصروف', '24298', '36860', '2024-11-05 21:02:35', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'محمد عبدة', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24298';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:32:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:02:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:02:36', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:32:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:02:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:02:38', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:32:39";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:02:39", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:02:39', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:32:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:02:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:02:49', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'عمر', '', '20', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '36840',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36860.00','20', '1', '1', 'إضافة مصروف', '24299', '36840', '2024-11-05 21:02:49', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'عمر', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24299';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:32:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:02:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:02:49', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:32:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:02:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:02:51', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:33:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:03:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:03:55', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:34:08";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:04:08", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:04:08', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '25', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '36815',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36840.00','25', '1', '1', 'إضافة مصروف', '24300', '36815', '2024-11-05 21:04:08', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '25.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24300';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:34:09";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:04:09", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:04:09', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:34:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:04:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 21:04:11', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:41:45";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 21:11:45", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:11:45', '75', 'addAndRetuen', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a66968d033
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9529,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 20:40:22', '0672a66968d033', '9529', '0.00', '13945', '900', '1', '14845.00', '13945', '0', '13945', '1', '2024-11-05 21:11:45', '', '75', '0', 'احمد سعيد f856', '2', '1', '3', '86', 'احمد سعيد f856', '45' ,'0','','','','','-1','0','0','0','0','0','13945','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '13945', userid = '75' WHERE clientid = '9529';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9529','0.00','13945','0','اضافة فاتورة مبيعات','143374', '13945', '2024-11-05 21:11:45', '75', 'sellbillController.php', 'اضافة فاتورة مبيعات', '13945', '0', null, '0', null, null,'', '0','1','1','13945','1','2024-11-05 20:40:22','0','0');
UPDATE client SET  inUse = 0 where clientid = 9529;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34201;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('575','H1356', '143374', '14', '15475', '1', '650', '650', '0', '', '1', '2024-11-05 21:11:45', '15475', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34201-1,','1','1','0','0','650','650','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 575.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 575.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 575, meanbuyprice_withTax = 591, lastbuyprice_withDiscountAndTax = 575
                where sellbilldetailid = 524141;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15475, '2024-11-05', 610.59279218592, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610.59279218592, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 610.59279218592, 575, 575
                    , 575, 575, 575, 575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 575, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610.59279218592, sellCostBuyPrice =sellCostBuyPrice+575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '75', storedetaildate = '2024-11-05 21:11:45' WHERE storedetailid = '15474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15475', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '15', '75', '2024-11-05 21:11:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33878;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('550','06737', '143374', '5', '15281', '1', '620', '620', '0', '', '1', '2024-11-05 21:11:45', '15281', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33878-1,','1','1','0','0','620','620','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 3934.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 3934.00
        
                where sellbilldetailid = 524142;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15281, '2024-11-05', 582.41158639272, 520, 520
                    , 3934, 520, 3934, 528.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+582.41158639272, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3934
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3934
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+528.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 582.41158639272, 520, 520
                    , 3934, 520, 3934, 528.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+582.41158639272, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3934
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3934
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+528.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 21:11:45' WHERE storedetailid = '15280';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15281', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-05 21:11:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34405;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','H1374', '143374', '14', '15555', '1', '390', '390', '0', '', '1', '2024-11-05 21:11:45', '15555', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34405-1,','1','1','0','0','390','390','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 5034, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 524143;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15555, '2024-11-05', 366.35567531155, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 5034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+366.35567531155, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 366.35567531155, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 5034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+366.35567531155, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '75', storedetaildate = '2024-11-05 21:11:45' WHERE storedetailid = '15554';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15555', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '21', '75', '2024-11-05 21:11:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34480;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','H1397', '143374', '14', '15615', '2', '520', '1040', '0', '', '1', '2024-11-05 21:11:45', '15615', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34480-2,','1','1','0','0','520','1040','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 524144;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15615, '2024-11-05', 976.94846749747, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+976.94846749747, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 976.94846749747, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+976.94846749747, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '75', storedetaildate = '2024-11-05 21:11:45' WHERE storedetailid = '15614';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15615', '1', '2', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '27', '75', '2024-11-05 21:11:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34493;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34570;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','H1377', '143374', '14', '15585', '5', '400', '2000', '0', '', '1', '2024-11-05 21:11:46', '15585', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34493-2,34570-3,','1','1','0','0','400','2000','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 299.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 299.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 264, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 524145;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15585, '2024-11-05', 1878.7470528798, 1550, 1550
                    , 1495, 1550, 1495, 1510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1550, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1878.7470528798, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1878.7470528798, 1550, 1550
                    , 1495, 1550, 1495, 1510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1878.7470528798, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1495
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1495
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '58', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15584';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15585', '1', '5', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '63', '58', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34225;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','H1301', '143374', '14', '15379', '1', '475', '475', '0', '', '1', '2024-11-05 21:11:46', '15379', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34225-1,','1','1','0','0','475','475','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 524146;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15379, '2024-11-05', 446.20242505894, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+446.20242505894, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 446.20242505894, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+446.20242505894, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15378';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15379', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34815;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K792', '143374', '7', '15813', '1', '350', '350', '0', '', '1', '2024-11-05 21:11:46', '15813', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34815-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 279.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 279.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 278, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 524147;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15813, '2024-11-05', 328.78073425396, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+328.78073425396, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 328.78073425396, 285, 285
                    , 279, 285, 279, 273.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 278, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+328.78073425396, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+279
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+279
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+273.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+278
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15812';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15813', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34', '33', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34816;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','R3276', '143374', '1', '15814', '1', '385', '385', '0', '', '1', '2024-11-05 21:11:46', '15814', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34816-1,','1','1','0','0','385','385','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 524148;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15814, '2024-11-05', 361.65880767935, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+361.65880767935, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 361.65880767935, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+361.65880767935, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15813';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15814', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34808;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','06939', '143374', '5', '15807', '1', '210', '210', '0', '', '1', '2024-11-05 21:11:46', '15807', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34808-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 524149;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15807, '2024-11-05', 197.26844055237, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+197.26844055237, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 197.26844055237, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 160, 160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+197.26844055237, sellCostBuyPrice =sellCostBuyPrice+160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15806';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15807', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 34806;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','06929', '143374', '5', '15805', '4', '270', '1080', '0', '', '1', '2024-11-05 21:11:46', '15805', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34806-4,','1','1','0','0','270','1080','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 524150;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15805, '2024-11-05', 1014.5234085551, 800, 800
                    , 800, 800, 800, 800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 800, 800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1014.5234085551, sellCostBuyPrice =sellCostBuyPrice+800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1014.5234085551, 800, 800
                    , 800, 800, 800, 800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 800, 800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1014.5234085551, sellCostBuyPrice =sellCostBuyPrice+800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15804';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15805', '1', '4', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '9', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34561;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0K780', '143374', '7', '15672', '3', '240', '720', '0', '', '1', '2024-11-05 21:11:46', '15672', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34561-3,','1','1','0','0','240','720','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
        , lastbuyprice_withTax = 195, meanbuyprice_withTax = 197, lastbuyprice_withDiscountAndTax = 195
                where sellbilldetailid = 524151;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15672, '2024-11-05', 676.34893903671, 585, 585
                    , 585, 585, 585, 588.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 585, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+676.34893903671, sellCostBuyPrice =sellCostBuyPrice+585
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+585, sellCostMeanBuyPrice = sellCostMeanBuyPrice+585
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+585, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+585
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+588.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+585
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 676.34893903671, 585, 585
                    , 585, 585, 585, 588.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 585, 591, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+676.34893903671, sellCostBuyPrice =sellCostBuyPrice+585
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+585, sellCostMeanBuyPrice = sellCostMeanBuyPrice+585
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+585, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+585
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+588.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+585
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+591
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15671';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15672', '1', '3', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '29', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34858;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('220','0K793', '143374', '7', '15834', '2', '280', '560', '0', '', '1', '2024-11-05 21:11:46', '15834', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34858-2,','1','1','0','0','280','560','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 220, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 524152;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15834, '2024-11-05', 526.04917480633, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 440, 440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+526.04917480633, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 526.04917480633, 440, 440
                    , 440, 440, 440, 440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 440, 440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+526.04917480633, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15834', '1', '2', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '25', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33243;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','05901', '143374', '5', '13179', '1', '210', '210', '0', '', '1', '2024-11-05 21:11:46', '13179', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33243-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        
                where sellbilldetailid = 524153;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13179, '2024-11-05', 197.26844055237, 140, 140
                    , 141, 140, 141, 141.43
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+197.26844055237, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141.43
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 197.26844055237, 140, 140
                    , 141, 140, 141, 141.43
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+197.26844055237, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141.43
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '13178';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13179', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 34813;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06935', '143374', '5', '15812', '3', '210', '630', '0', '', '1', '2024-11-05 21:11:46', '15812', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34813-3,','1','1','0','0','210','630','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where sellbilldetailid = 524154;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15812, '2024-11-05', 591.80532165712, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+591.80532165712, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 591.80532165712, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+591.80532165712, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15811';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15812', '1', '3', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '10', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34702;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','R3174', '143374', '1', '15319', '1', '330', '330', '0', '', '1', '2024-11-05 21:11:46', '15319', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34702-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 178, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 524155;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15319, '2024-11-05', 309.99326372516, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+309.99326372516, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 309.99326372516, 285, 285
                    , 285, 285, 285, 283.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 285, 178, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+309.99326372516, sellCostBuyPrice =sellCostBuyPrice+285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+283.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+178
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15319', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 24954;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','0K657', '143374', '7', '11378', '1', '240', '240', '0', '', '1', '2024-11-05 21:11:46', '11378', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','24954-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where sellbilldetailid = 524156;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11378, '2024-11-05', 225.44964634557, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225.44964634557, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 225.44964634557, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225.44964634557, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '11377';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11378', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34730;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','0K787', '143374', '7', '15764', '1', '300', '300', '0', '', '1', '2024-11-05 21:11:46', '15764', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34730-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 115, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 524157;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15764, '2024-11-05', 281.81205793196, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+281.81205793196, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 281.81205793196, 230, 230
                    , 230, 230, 230, 230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 230, 115, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+281.81205793196, sellCostBuyPrice =sellCostBuyPrice+230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15764', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34728;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','R3270', '143374', '1', '15762', '1', '300', '300', '0', '', '1', '2024-11-05 21:11:46', '15762', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34728-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 125, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 524158;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15762, '2024-11-05', 281.81205793196, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+281.81205793196, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 281.81205793196, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+281.81205793196, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15761';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15762', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34881;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','0K794', '143374', '7', '15843', '1', '300', '300', '0', '', '1', '2024-11-05 21:11:46', '15843', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34881-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 524159;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15843, '2024-11-05', 281.81205793196, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+281.81205793196, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 281.81205793196, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+281.81205793196, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15842';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15843', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '25', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34877;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3262', '143374', '1', '15636', '1', '220', '220', '0', '', '1', '2024-11-05 21:11:46', '15636', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34877-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 524160;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15636, '2024-11-05', 206.66217581677, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+206.66217581677, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 206.66217581677, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 165, 165, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+206.66217581677, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+165
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15635';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15636', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '24', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34758;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','H1444', '143374', '14', '15782', '1', '500', '500', '0', '', '1', '2024-11-05 21:11:46', '15782', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34758-1,','1','1','0','0','500','500','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 524161;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15782, '2024-11-05', 469.68676321994, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+469.68676321994, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 469.68676321994, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+469.68676321994, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15781';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15782', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34725;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','0K788', '143374', '7', '15759', '1', '225', '225', '0', '', '1', '2024-11-05 21:11:46', '15759', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34725-1,','1','1','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        , lastbuyprice_withTax = 175, meanbuyprice_withTax = 88, lastbuyprice_withDiscountAndTax = 175
                where sellbilldetailid = 524162;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15759, '2024-11-05', 211.35904344897, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 175, 88, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+211.35904344897, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+88
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 211.35904344897, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 175, 88, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+211.35904344897, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+88
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15758';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15759', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34770;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','0K791', '143374', '7', '15784', '1', '240', '240', '0', '', '1', '2024-11-05 21:11:46', '15784', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34770-1,','1','1','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 524163;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15784, '2024-11-05', 225.44964634557, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225.44964634557, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 225.44964634557, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225.44964634557, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15783';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15784', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34448;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','H1392', '143374', '14', '15588', '1', '580', '580', '0', '', '1', '2024-11-05 21:11:46', '15588', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34448-1,','1','1','0','0','580','580','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 524164;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15588, '2024-11-05', 544.83664533513, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+544.83664533513, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 544.83664533513, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+544.83664533513, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15587';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15588', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34726;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('215','0K789', '143374', '7', '15760', '1', '275', '275', '0', '', '1', '2024-11-05 21:11:46', '15760', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34726-1,','1','1','0','0','275','275','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 215.00 , meanbuyprice = 215.00, lastbuyprice_withDiscount = 215.00, meanbuyprice_withDiscount = 215.00
        , lastbuyprice_withTax = 215, meanbuyprice_withTax = 215, lastbuyprice_withDiscountAndTax = 215
                where sellbilldetailid = 524165;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15760, '2024-11-05', 258.32771977097, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+258.32771977097, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 258.32771977097, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+258.32771977097, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15760', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34447;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('305','R3256', '143374', '1', '15587', '1', '360', '360', '0', '', '1', '2024-11-05 21:11:46', '15587', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34447-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 305.00 , meanbuyprice = 305.00, lastbuyprice_withDiscount = 305.00, meanbuyprice_withDiscount = 305.00
        , lastbuyprice_withTax = 305, meanbuyprice_withTax = 305, lastbuyprice_withDiscountAndTax = 305
                where sellbilldetailid = 524166;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15587, '2024-11-05', 338.17446951836, 305, 305
                    , 305, 305, 305, 305
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 305, 305, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+338.17446951836, sellCostBuyPrice =sellCostBuyPrice+305
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+305, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+305
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+305
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+305
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+305
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 338.17446951836, 305, 305
                    , 305, 305, 305, 305
                    , 0, 0, 0, 0
                    , 0, 0, 0, 305, 305, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+338.17446951836, sellCostBuyPrice =sellCostBuyPrice+305
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+305, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+305
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+305
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+305
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+305
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '75', storedetaildate = '2024-11-05 21:11:46' WHERE storedetailid = '15586';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15587', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '75', '2024-11-05 21:11:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34432;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06845', '143374', '5', '15576', '1', '200', '200', '0', '', '1', '2024-11-05 21:11:47', '15576', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34432-1,','1','1','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 129, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 524167;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15576, '2024-11-05', 187.87470528798, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.87470528798, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+129
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 187.87470528798, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.87470528798, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+129
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-05 21:11:47' WHERE storedetailid = '15575';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15576', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-05 21:11:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34591;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06874', '143374', '5', '15687', '1', '380', '380', '0', '', '1', '2024-11-05 21:11:47', '15687', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34591-1,','1','1','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 524168;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15687, '2024-11-05', 356.96194004715, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+356.96194004715, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 356.96194004715, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+356.96194004715, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '75', storedetaildate = '2024-11-05 21:11:47' WHERE storedetailid = '15686';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15687', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17', '16', '75', '2024-11-05 21:11:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34491;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06508', '143374', '5', '14857', '1', '290', '290', '0', '', '1', '2024-11-05 21:11:47', '14857', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34491-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 242.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 242.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 213, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 524169;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14857, '2024-11-05', 272.41832266756, 240, 240
                    , 242, 240, 242, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 213, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+272.41832266756, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+242
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+213
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 272.41832266756, 240, 240
                    , 242, 240, 242, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 213, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+272.41832266756, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+242
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+213
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '75', storedetaildate = '2024-11-05 21:11:47' WHERE storedetailid = '14856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14857', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '28', '75', '2024-11-05 21:11:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34558;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('155','06887', '143374', '5', '15670', '1', '210', '210', '0', '', '1', '2024-11-05 21:11:47', '15670', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34558-1,','1','1','0','0','210','210','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 155.00 , meanbuyprice = 155.00, lastbuyprice_withDiscount = 155.00, meanbuyprice_withDiscount = 155.00
        , lastbuyprice_withTax = 155, meanbuyprice_withTax = 155, lastbuyprice_withDiscountAndTax = 155
                where sellbilldetailid = 524170;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15670, '2024-11-05', 197.26844055237, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+197.26844055237, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 197.26844055237, 155, 155
                    , 155, 155, 155, 155
                    , 0, 0, 0, 0
                    , 0, 0, 0, 155, 155, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+197.26844055237, sellCostBuyPrice =sellCostBuyPrice+155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+155, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+155
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+155
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+155
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '75', storedetaildate = '2024-11-05 21:11:47' WHERE storedetailid = '15669';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15670', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '75', '2024-11-05 21:11:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30687;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','06052', '143374', '5', '13676', '1', '410', '410', '0', '', '1', '2024-11-05 21:11:47', '13676', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30687-1,','1','1','0','0','410','410','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        
                where sellbilldetailid = 524171;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13676, '2024-11-05', 385.14314584035, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385.14314584035, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 385.14314584035, 375, 375
                    , 375, 375, 375, 375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+385.14314584035, sellCostBuyPrice =sellCostBuyPrice+375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '75', storedetaildate = '2024-11-05 21:11:47' WHERE storedetailid = '13675';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13676', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '75', '2024-11-05 21:11:47','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34742;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('120','R3243', '143374', '1', '15624', '1', '165', '165', '0', '', '1', '2024-11-05 21:11:47', '15624', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34742-1,','1','1','0','0','165','165','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 120.00 , meanbuyprice = 119.00, lastbuyprice_withDiscount = 120.00, meanbuyprice_withDiscount = 119.00
        , lastbuyprice_withTax = 120, meanbuyprice_withTax = 118, lastbuyprice_withDiscountAndTax = 120
                where sellbilldetailid = 524172;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15624, '2024-11-05', 154.99663186258, 120, 120
                    , 119, 120, 119, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 120, 118, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+154.99663186258, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 154.99663186258, 120, 120
                    , 119, 120, 119, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 120, 118, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+154.99663186258, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '75', storedetaildate = '2024-11-05 21:11:47' WHERE storedetailid = '15623';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15624', '1', '1', '1', '143374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '75', '2024-11-05 21:11:47','0','0');
UPDATE client SET  delegateid = 86 where clientid = 9529;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 13945, 11950, 11950
                    , 15305, 11950, 15305, 11908.93
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10330, 14245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13945, sellCostBuyPrice =sellCostBuyPrice+11950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15305
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11908.93
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9529, '2024-11-05', 13945, 11950, 11950
                    , 15305, 11950, 15305, 11908.93
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10330, 14245, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13945, sellCostBuyPrice =sellCostBuyPrice+11950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15305
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11908.93
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14245
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 13945, 11950, 11950
                    , 15305, 11950, 15305, 11908.93, 10330, 14245)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+13945, netSellCostBuyPrice = netSellCostBuyPrice+11950
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+11950
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+15305
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+11950
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+15305
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+11908.93
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+10330
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+14245;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a66968d033 and sellbillId = 143374 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:41:47";
UPDATE user SET loginip = "192.168.1.57", lastactivetime = "2024-11-05 21:11:47", deviceType = "DESKTOP" WHERE userid = 75;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:11:47', '75', 'addsellBill', '192.168.1.57', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE userid = 75;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:49:21";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:19:21", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:19:21', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:54:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:24:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:24:04', '9', 'addAndRetuen', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addAndRetuen');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0672a6fb9e8112
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-11-05 21:19:21', '0672a6fb9e8112', '1', '0.00', '0', '5', '1', '1120.00', '1115', '1115', '0', '1', '2024-11-05 21:24:04', '', '9', '0', 'نقدي', '1', '0', '3', '95', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1115','0','','0','0','1115','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2024-11-05','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '9' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','143375', '0', '2024-11-05 21:24:04', '9', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1115', '0', null, '0', null, null,'', '0','1','1','0','1','2024-11-05 21:19:21','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','0K781', '143375', '7', '15694', '1', '350', '350', '0', '', '1', '2024-11-05 21:24:04', '15694', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34793-1,','1','1','0','0','350','350','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 279, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 524173;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15694, '2024-11-05', 348.4375, 270, 270
                    , 275, 270, 275, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+348.4375, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+279
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 348.4375, 270, 270
                    , 275, 270, 275, 280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 270, 279, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+348.4375, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+279
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '83', userid = '9', storedetaildate = '2024-11-05 21:24:04' WHERE storedetailid = '15693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15694', '1', '1', '1', '143375', 'اضافة فاتورة مبيعات', 'sellbillController.php', '84', '83', '9', '2024-11-05 21:24:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34675;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','R3269', '143375', '1', '15742', '1', '250', '250', '0', '', '1', '2024-11-05 21:24:04', '15742', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34675-1,','1','1','0','0','250','250','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 100, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 524174;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15742, '2024-11-05', 248.88392857143, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 200, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+248.88392857143, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 248.88392857143, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+248.88392857143, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '9', storedetaildate = '2024-11-05 21:24:04' WHERE storedetailid = '15741';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15742', '1', '1', '1', '143375', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '9', '2024-11-05 21:24:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34397;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','R3192', '143375', '1', '15363', '1', '220', '220', '0', '', '1', '2024-11-05 21:24:04', '15363', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34397-1,','1','1','0','0','220','220','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        
                where sellbilldetailid = 524175;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15363, '2024-11-05', 219.01785714286, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+219.01785714286, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 219.01785714286, 165, 165
                    , 165, 165, 165, 165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+219.01785714286, sellCostBuyPrice =sellCostBuyPrice+165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '9', storedetaildate = '2024-11-05 21:24:04' WHERE storedetailid = '15362';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15363', '1', '1', '1', '143375', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '9', '2024-11-05 21:24:04','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 34642;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','06900', '143375', '5', '15715', '1', '300', '300', '0', '', '1', '2024-11-05 21:24:04', '15715', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','34642-1,','1','1','0','0','300','300','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 239.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 239.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 238, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 524176;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15715, '2024-11-05', 298.66071428571, 240, 240
                    , 239, 240, 239, 238.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 238, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+298.66071428571, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+239
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+239
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+238
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 298.66071428571, 240, 240
                    , 239, 240, 239, 238.33
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 238, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+298.66071428571, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+239
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+239
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+238.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+238
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '36', userid = '9', storedetaildate = '2024-11-05 21:24:04' WHERE storedetailid = '15714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15715', '1', '1', '1', '143375', 'اضافة فاتورة مبيعات', 'sellbillController.php', '37', '36', '9', '2024-11-05 21:24:04','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '37930',  userid = '9' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36815','1115', '0', '1', 'اضافة فاتورة مبيعات', '143375', '37930', '2024-11-05 21:24:04', '9',  'sellbillController.php','1','','0');
UPDATE client SET  delegateid = 95 where clientid = 1;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1115, 875, 875
                    , 879, 875, 879, 883.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,710, 617, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1115, sellCostBuyPrice =sellCostBuyPrice+875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+879
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+879
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+883.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+710
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+617
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1115, 875, 875
                    , 879, 875, 879, 883.33
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,710, 617, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1115, sellCostBuyPrice =sellCostBuyPrice+875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+879
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+879
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+883.33
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+710
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+617
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1115, 875, 875
                    , 879, 875, 879, 883.33, 710, 617)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1115, netSellCostBuyPrice = netSellCostBuyPrice+875
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+875
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+879
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+875
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+879
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+883.33
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+710
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+617;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0672a6fb9e8112 and sellbillId = 143375 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 17:54:05";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 21:24:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:24:05', '9', 'addsellBill', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:07:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:37:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:37:35', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:07:49";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:37:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:37:49', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:07:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:37:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:37:56', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=141444');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:09:38";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:39:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:39:38', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:09:53";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:39:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:39:53', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:09:58";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:39:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:39:58', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142926');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:13:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:43:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:43:17', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:21:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:51:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:51:55', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:22:03";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:52:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:52:03', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143309');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:22:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:52:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:52:31', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:22:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:52:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:52:42', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:23:10";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:53:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:53:10', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:23:20";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:53:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:53:20', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=143138&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 143138
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 143138;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 21:53:20', userid = '75',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '143138';
UPDATE sellbilldetail SET  lastbuyprice = 595.00 , meanbuyprice = 568.00, lastbuyprice_withDiscount = 595.00, meanbuyprice_withDiscount = 568.00
        
                where sellbilldetailid = 523241;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8581, '2024-11-05', 640, 540, 595
                    , 568, 595, 568, 553.75
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-640, sellCostBuyPrice =sellCostBuyPrice-540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-595, sellCostMeanBuyPrice = sellCostMeanBuyPrice-568
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-568
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-553.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 640, 540, 595
                    , 568, 595, 568, 553.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-640, sellCostBuyPrice =sellCostBuyPrice-540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-595, sellCostMeanBuyPrice = sellCostMeanBuyPrice-568
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-595, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-568
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-553.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 21:53:20' WHERE storedetailid = '8580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8581', '1', '1', '0', '143138', 'حذف فاتورة مبيعات', 'sellbillController.php', '4', '5', '2', '2024-11-05 21:53:20','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 29376;
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 421.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 421.00
        
                where sellbilldetailid = 523242;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12989, '2024-11-05', 440, 420, 420
                    , 421, 420, 421, 422.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, sellCostBuyPrice =sellCostBuyPrice-420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-420, sellCostMeanBuyPrice = sellCostMeanBuyPrice-421
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-421
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-422.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 440, 420, 420
                    , 421, 420, 421, 422.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, sellCostBuyPrice =sellCostBuyPrice-420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-420, sellCostMeanBuyPrice = sellCostMeanBuyPrice-421
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-421
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-422.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 21:53:20' WHERE storedetailid = '12988';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12989', '1', '1', '0', '143138', 'حذف فاتورة مبيعات', 'sellbillController.php', '1', '2', '2', '2024-11-05 21:53:20','0','0');
CALL clientInUse(5739,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-1', userid = '2' WHERE clientid = '5739';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5739','1110.00','1111.00','1','حذف فاتورة مبيعات','143138', '-1', '2024-11-05 21:53:20', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '1111', '0', null, '0', null, null,'', '0','1','1','1111','1','2024-11-04 17:09:03','0','0');
UPDATE client SET  inUse = 0 where clientid = 5739;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1111, 960, 1015
                    , 989, 1015, 989, 976.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1111, sellCostBuyPrice =sellCostBuyPrice-960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1015, sellCostMeanBuyPrice = sellCostMeanBuyPrice-989
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1015, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-989
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-976.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5739, '2024-11-05', 1111, 960, 1015
                    , 989, 1015, 989, 976.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1111, sellCostBuyPrice =sellCostBuyPrice-960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1015, sellCostMeanBuyPrice = sellCostMeanBuyPrice-989
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1015, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-989
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-976.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1111, 960, 1015
                    , 989, 1015, 989, 976.25, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-1111, netSellCostBuyPrice = netSellCostBuyPrice-960
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1015
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-989
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1015
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-989
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-976.25
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 143138
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:23:20";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:53:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:53:20', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:23:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:53:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:53:22', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:23:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:53:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:53:44', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:23:53";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:53:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:53:53', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:23:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:53:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:53:57', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143275');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:24:07";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:54:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:54:07', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:24:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:54:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:54:18', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:24:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:54:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:54:24', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143322');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:24:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:54:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:54:31', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:27:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:57:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:57:25', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:27:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:57:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:57:31', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143365');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:28:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:58:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:58:44', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:29:11";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:59:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 21:59:11', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:29:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 21:59:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 21:59:27', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=140427');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:30:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:00:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:00:16', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:30:36";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:00:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:00:36', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:30:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:00:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:00:39', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142700');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:31:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:01:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:01:01', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:31:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:01:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:01:14', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:31:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:01:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:01:18', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142354');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:31:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:01:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:01:54', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:32:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:02:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:02:05', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:32:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:02:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:02:18', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:32:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:02:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:02:57', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:33:13";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:03:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:03:14', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=138751&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 138751
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 138751;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 22:03:14', userid = '9',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '138751';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33113;
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        
                where sellbilldetailid = 507074;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14962, '2024-11-05', 220, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-170, sellCostMeanBuyPrice = sellCostMeanBuyPrice-170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 220, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-220, sellCostBuyPrice =sellCostBuyPrice-170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-170, sellCostMeanBuyPrice = sellCostMeanBuyPrice-170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 22:03:14' WHERE storedetailid = '14961';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14962', '1', '1', '0', '138751', 'حذف فاتورة مبيعات', 'sellbillController.php', '7', '8', '2', '2024-11-05 22:03:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 30831;
UPDATE sellbilldetail SET  lastbuyprice = 145.00 , meanbuyprice = 145.00, lastbuyprice_withDiscount = 145.00, meanbuyprice_withDiscount = 145.00
        
                where sellbilldetailid = 507075;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13882, '2024-11-05', 85, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-85, sellCostBuyPrice =sellCostBuyPrice-145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-145, sellCostMeanBuyPrice = sellCostMeanBuyPrice-145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 85, 145, 145
                    , 145, 145, 145, 145
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-85, sellCostBuyPrice =sellCostBuyPrice-145
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-145, sellCostMeanBuyPrice = sellCostMeanBuyPrice-145
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-145, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-145
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-145
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 22:03:14' WHERE storedetailid = '13881';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13882', '1', '1', '0', '138751', 'حذف فاتورة مبيعات', 'sellbillController.php', '1', '2', '2', '2024-11-05 22:03:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 28763;
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        
                where sellbilldetailid = 507076;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12383, '2024-11-05', 205, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-205, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 205, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-205, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 22:03:14' WHERE storedetailid = '12382';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12383', '1', '1', '0', '138751', 'حذف فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-05 22:03:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 27034;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 507077;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11887, '2024-11-05', 210, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-210, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 210, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-210, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '-1', userid = '2', storedetaildate = '2024-11-05 22:03:14' WHERE storedetailid = '11886';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11887', '1', '1', '0', '138751', 'حذف فاتورة مبيعات', 'sellbillController.php', '-2', '-1', '2', '2024-11-05 22:03:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 28873;
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        
                where sellbilldetailid = 507078;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12847, '2024-11-05', 360, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-360, sellCostBuyPrice =sellCostBuyPrice-400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 360, 400, 400
                    , 400, 400, 400, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-360, sellCostBuyPrice =sellCostBuyPrice-400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 22:03:14' WHERE storedetailid = '12846';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12847', '1', '1', '0', '138751', 'حذف فاتورة مبيعات', 'sellbillController.php', '3', '4', '2', '2024-11-05 22:03:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 27965;
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        
                where sellbilldetailid = 507079;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12455, '2024-11-05', 90, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-90, sellCostBuyPrice =sellCostBuyPrice-160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-160, sellCostMeanBuyPrice = sellCostMeanBuyPrice-160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 90, 160, 160
                    , 160, 160, 160, 160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-90, sellCostBuyPrice =sellCostBuyPrice-160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-160, sellCostMeanBuyPrice = sellCostMeanBuyPrice-160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 22:03:14' WHERE storedetailid = '12454';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12455', '1', '1', '0', '138751', 'حذف فاتورة مبيعات', 'sellbillController.php', '0', '1', '2', '2024-11-05 22:03:14','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        
                where sellbilldetailid = 507080;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14021, '2024-11-05', 90, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-90, sellCostBuyPrice =sellCostBuyPrice-140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-140, sellCostMeanBuyPrice = sellCostMeanBuyPrice-140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 90, 140, 140
                    , 140, 140, 140, 140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-90, sellCostBuyPrice =sellCostBuyPrice-140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-140, sellCostMeanBuyPrice = sellCostMeanBuyPrice-140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '-1', userid = '2', storedetaildate = '2024-11-05 22:03:14' WHERE storedetailid = '14020';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14021', '1', '1', '0', '138751', 'حذف فاتورة مبيعات', 'sellbillController.php', '-2', '-1', '2', '2024-11-05 22:03:14','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 27984;
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 490.00
        
                where sellbilldetailid = 507081;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12466, '2024-11-05', 400, 495, 495
                    , 490, 495, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-495, sellCostMeanBuyPrice = sellCostMeanBuyPrice-490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 495, 495
                    , 490, 495, 490, 490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-495
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-495, sellCostMeanBuyPrice = sellCostMeanBuyPrice-490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-495, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 22:03:14' WHERE storedetailid = '12465';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12466', '1', '1', '0', '138751', 'حذف فاتورة مبيعات', 'sellbillController.php', '1', '2', '2', '2024-11-05 22:03:14','0','0');
CALL clientInUse(9048,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '420', userid = '2' WHERE clientid = '9048';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9048','640.00','220.00','1','حذف فاتورة مبيعات','138751', '420', '2024-11-05 22:03:14', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '1660', '0', null, '0', null, null,'', '0','1','1','220','1','2024-10-04 14:55:39','0','0');
UPDATE client SET  inUse = 0 where clientid = 9048;
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '36490',  userid = '2' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('37930','1440', '1', '1', 'حذف فاتورة مبيعات', '138751', '36490', '2024-11-05 22:03:14', '2',  'sellbillController.php','9048','','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1660, 2000, 2000
                    , 1995, 2000, 1995, 1995
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1660, sellCostBuyPrice =sellCostBuyPrice-2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1995
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1995
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1995
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9048, '2024-11-05', 1660, 2000, 2000
                    , 1995, 2000, 1995, 1995
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1660, sellCostBuyPrice =sellCostBuyPrice-2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1995
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1995
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1995
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1660, 2000, 2000
                    , 1995, 2000, 1995, 1995, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-1660, netSellCostBuyPrice = netSellCostBuyPrice-2000
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-2000
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1995
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-2000
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1995
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1995
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 138751
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:33:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:03:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:03:14', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:33:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:03:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:03:16', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:33:32";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:03:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:03:32', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:33:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:03:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:03:45', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=142354&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 142354
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 142354;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 22:03:45', userid = '101',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '142354';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 32331;
UPDATE sellbilldetail SET  lastbuyprice = 75.00 , meanbuyprice = 75.00, lastbuyprice_withDiscount = 75.00, meanbuyprice_withDiscount = 75.00
        
                where sellbilldetailid = 520190;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14188, '2024-11-05', 80, 75, 75
                    , 75, 75, 75, 75
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-80, sellCostBuyPrice =sellCostBuyPrice-75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-75, sellCostMeanBuyPrice = sellCostMeanBuyPrice-75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 80, 75, 75
                    , 75, 75, 75, 75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-80, sellCostBuyPrice =sellCostBuyPrice-75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-75, sellCostMeanBuyPrice = sellCostMeanBuyPrice-75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 22:03:45' WHERE storedetailid = '14187';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14188', '1', '1', '0', '142354', 'حذف فاتورة مبيعات', 'sellbillController.php', '4', '5', '2', '2024-11-05 22:03:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 28847;
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 986.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 986.00
        
                where sellbilldetailid = 520191;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12542, '2024-11-05', 185, 240, 240
                    , 986, 240, 986, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-185, sellCostBuyPrice =sellCostBuyPrice-240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-240, sellCostMeanBuyPrice = sellCostMeanBuyPrice-986
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-986
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 185, 240, 240
                    , 986, 240, 986, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-185, sellCostBuyPrice =sellCostBuyPrice-240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-240, sellCostMeanBuyPrice = sellCostMeanBuyPrice-986
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-986
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 22:03:45' WHERE storedetailid = '12541';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12542', '1', '1', '0', '142354', 'حذف فاتورة مبيعات', 'sellbillController.php', '0', '1', '2', '2024-11-05 22:03:45','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 290.00 , meanbuyprice = 290.00, lastbuyprice_withDiscount = 290.00, meanbuyprice_withDiscount = 290.00
        
                where sellbilldetailid = 520192;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12760, '2024-11-05', 195, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-290, sellCostMeanBuyPrice = sellCostMeanBuyPrice-290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 195, 290, 290
                    , 290, 290, 290, 290
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-195, sellCostBuyPrice =sellCostBuyPrice-290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-290, sellCostMeanBuyPrice = sellCostMeanBuyPrice-290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-290, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-290
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-290
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '-1', userid = '2', storedetaildate = '2024-11-05 22:03:45' WHERE storedetailid = '12759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12760', '1', '1', '0', '142354', 'حذف فاتورة مبيعات', 'sellbillController.php', '-2', '-1', '2', '2024-11-05 22:03:45','0','0');
CALL clientInUse(9048,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-65', userid = '2' WHERE clientid = '9048';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9048','420.00','485.00','1','حذف فاتورة مبيعات','142354', '-65', '2024-11-05 22:03:45', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '485', '0', null, '0', null, null,'', '0','1','1','485','1','2024-10-29 17:28:49','0','0');
UPDATE client SET  inUse = 0 where clientid = 9048;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 485, 605, 605
                    , 1351, 605, 1351, 605
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-485, sellCostBuyPrice =sellCostBuyPrice-605
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-605, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1351
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-605, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1351
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-605
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9048, '2024-11-05', 485, 605, 605
                    , 1351, 605, 1351, 605
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-485, sellCostBuyPrice =sellCostBuyPrice-605
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-605, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1351
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-605, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1351
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-605
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 485, 605, 605
                    , 1351, 605, 1351, 605, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-485, netSellCostBuyPrice = netSellCostBuyPrice-605
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-605
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1351
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-605
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1351
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-605
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 142354
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:33:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:03:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:03:46', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:33:48";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:03:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:03:48', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:37:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:07:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:07:05', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:37:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:07:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:07:21', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=130450&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 130450
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 130450;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 22:07:21', userid = '2',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '130450';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31307;
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 291.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 291.00
        
                where sellbilldetailid = 473352;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13876, '2024-11-05', 280, 240, 240
                    , 291, 240, 291, 236.25
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-280, sellCostBuyPrice =sellCostBuyPrice-240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-240, sellCostMeanBuyPrice = sellCostMeanBuyPrice-291
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-291
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-236.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 240, 240
                    , 291, 240, 291, 236.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-280, sellCostBuyPrice =sellCostBuyPrice-240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-240, sellCostMeanBuyPrice = sellCostMeanBuyPrice-291
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-291
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-236.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2024-11-05 22:07:21' WHERE storedetailid = '13875';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13876', '1', '1', '0', '130450', 'حذف فاتورة مبيعات', 'sellbillController.php', '1', '2', '2', '2024-11-05 22:07:21','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31379;
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        
                where sellbilldetailid = 473353;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13900, '2024-11-05', 260, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-260, sellCostBuyPrice =sellCostBuyPrice-210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-210, sellCostMeanBuyPrice = sellCostMeanBuyPrice-210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 260, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-260, sellCostBuyPrice =sellCostBuyPrice-210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-210, sellCostMeanBuyPrice = sellCostMeanBuyPrice-210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 22:07:21' WHERE storedetailid = '13899';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13900', '1', '1', '0', '130450', 'حذف فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-11-05 22:07:21','0','0');
CALL clientInUse(9419,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '9419';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9419','556.00','556.00','1','حذف فاتورة مبيعات','130450', '0', '2024-11-05 22:07:21', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '556', '0', null, '0', null, null,'', '0','1','1','556','1','2024-08-19 17:04:32','0','0');
UPDATE client SET  inUse = 0 where clientid = 9419;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 556, 450, 450
                    , 501, 450, 501, 446.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-556, sellCostBuyPrice =sellCostBuyPrice-450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-501
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-501
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-446.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9419, '2024-11-05', 556, 450, 450
                    , 501, 450, 501, 446.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-556, sellCostBuyPrice =sellCostBuyPrice-450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-501
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-501
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-446.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 556, 450, 450
                    , 501, 450, 501, 446.25, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-556, netSellCostBuyPrice = netSellCostBuyPrice-450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-501
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-501
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-446.25
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 130450
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:37:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:07:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:07:22', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:37:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:07:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:07:24', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:37:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:07:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:07:42', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:37:47";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:07:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:07:47', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=134701');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:37:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:07:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:07:55', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:38:11";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:08:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:08:11', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:38:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:08:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:08:17', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=122654');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:38:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:08:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:08:21', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:38:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:08:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:08:44', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:39:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:09:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:09:06', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:45:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:15:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:15:05', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:45:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:15:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:15:09', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=127467');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:46:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:16:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:16:02', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:46:10";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:16:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:16:10', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=127467&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 127467
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 127467;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 22:16:10', userid = '75',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '127467';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 30875;
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 315.00
        
                where sellbilldetailid = 461729;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13816, '2024-11-05', 350, 300, 300
                    , 315, 300, 315, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-315
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-315
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 350, 300, 300
                    , 315, 300, 315, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-315
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-315
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '24', userid = '2', storedetaildate = '2024-11-05 22:16:10' WHERE storedetailid = '13815';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13816', '1', '1', '0', '127467', 'حذف فاتورة مبيعات', 'sellbillController.php', '23', '24', '2', '2024-11-05 22:16:10','0','0');
CALL clientInUse(9184,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '9184';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9184','366.00','366.00','1','حذف فاتورة مبيعات','127467', '0', '2024-11-05 22:16:10', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '366', '0', null, '0', null, null,'', '0','1','1','366','1','2024-08-02 17:10:39','0','0');
UPDATE client SET  inUse = 0 where clientid = 9184;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 366, 300, 300
                    , 315, 300, 315, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-366, sellCostBuyPrice =sellCostBuyPrice-300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-315
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-315
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9184, '2024-11-05', 366, 300, 300
                    , 315, 300, 315, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-366, sellCostBuyPrice =sellCostBuyPrice-300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-315
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-315
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 366, 300, 300
                    , 315, 300, 315, 300, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-366, netSellCostBuyPrice = netSellCostBuyPrice-300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-315
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-315
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 127467
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:46:10";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:16:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:16:11', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:46:12";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:16:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:16:12', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:46:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:16:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:16:28', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:46:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:16:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:16:39', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:46:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:16:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:16:44', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=128943');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:50:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:20:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:20:09', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:50:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:20:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:20:25', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:50:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:20:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:20:30', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=140702');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:51:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:21:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2024-11-05 22:21:16', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:51:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:21:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 22:21:27', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:51:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:21:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 22:21:46', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236065
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2570,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '35' , clientdate = '2024-11-05 22:21:46', userid = '2' WHERE clientid = '2570';
UPDATE client SET  inUse = 0 where clientid = 2570;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2570','315.00','280','1','ايصال تحصيل (( قبض من عميل ))','236065', '35', '2024-11-05 22:21:27', '2', 'clientPayedDeptController.php', '   ', '280', '0', null, '0', null, null,'', '-1','1','1','280','1','','851','0');
UPDATE save SET  savecurrentvalue = '251783.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('251503.50','280', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236065', '251783.5', '2024-11-05 22:21:46', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ام كندة 73', 'ام كندة 73', 'ام كندة 73', 'ام كندة 73', '58', '0', '35.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 22:21:46');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '280', '280', '2024-11-05', '2', '0', '0', '2024-11-05 22:21:46','اضافة ايصال سداد للعميل ام كندة 73','1','0','0','0','236065','clientPayedDeptController.php?do=show&id=236065');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119004', '-1', '280', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '280', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119004', '11243', '280', '','0');
UPDATE accountstree SET name = 'ام كندة 73', customName = 'ام كندة 73', customNameEn = 'ام كندة 73', nameEn = 'ام كندة 73', parent = '58', accountNature = '0', theValue = '-245', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 22:21:46' WHERE id = '11243';
UPDATE clientdebtchange SET clientid = '2570', clientdebtchangebefore = '315.000', clientdebtchangeamount = '280.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236065', clientdebtchangeafter = '35.000', clientdebtchangedate = '2024-11-05 22:21:27', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '280.00',discount='', reciptid='0', dailyentryid = '119004',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='280',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236065';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236065 -clientdebtchangeId = 236065
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:51:47";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:21:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 22:21:47', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:51:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:21:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:21:56', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:52:15";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:22:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:22:15', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =2570
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2570,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('2570','35.00','35','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 22:22:15', '2', 'clientDeficitController.php', '', '35', '0', null, '0', null, null,'', '0','1','1','35','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '2570';
UPDATE client SET  inUse = 0 where clientid = 2570;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =2570 ,id=236066
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:52:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:22:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:22:16', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:52:18";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:22:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:22:18', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:53:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:23:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:23:17', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:53:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:23:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:23:25', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:53:47";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:23:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:23:47', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=141892');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:53:50";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:23:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:23:50', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=137416');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:56:11";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:26:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:26:11', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:56:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:26:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:26:22', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:57:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:27:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:27:30', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=137416');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:57:49";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:27:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:27:49', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 137416 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 137416 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 137416;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 22:27:49', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '137416';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33613;
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 159, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 502172;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15166, '2024-11-05', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 350, 159, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-159
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 159, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-400, sellCostBuyPrice =sellCostBuyPrice-350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-159
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2024-11-05 22:27:49' WHERE storedetailid = '15165';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15166', '1', '1', '0', '137416', 'تعديل فاتورة مبيعات', 'sellbillController.php', '9', '10', '2', '2024-09-26 14:20:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33208;
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
        , lastbuyprice_withTax = 220, meanbuyprice_withTax = 28, lastbuyprice_withDiscountAndTax = 220
                where sellbilldetailid = 502173;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14524, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-280, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 220, 220
                    , 220, 220, 220, 220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-280, sellCostBuyPrice =sellCostBuyPrice-220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 22:27:49' WHERE storedetailid = '14523';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14524', '1', '1', '0', '137416', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '2', '2024-09-26 14:20:41','0','0');
CALL clientInUse(9360,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-404', userid = '2' WHERE clientid = '9360';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9360','298.00','702.00','1','تعديل فاتورة مبيعات','137416', '-404', '2024-09-26 14:20:41', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '702', '0', null, '0', null, null,'', '0','1','1','702','1','2024-09-26 14:20:41','0','0');
UPDATE client SET  inUse = 0 where clientid = 9360;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 702, 570, 570
                    , 570, 570, 570, 570
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,570, 187, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-702, sellCostBuyPrice =sellCostBuyPrice-570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-570, sellCostMeanBuyPrice = sellCostMeanBuyPrice-570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-570
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-570
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-187
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9360, '2024-11-05', 702, 570, 570
                    , 570, 570, 570, 570
                    , 0, 0, 0, 0
                    , 0, 0, 0, 570, 187, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-702, sellCostBuyPrice =sellCostBuyPrice-570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-570, sellCostMeanBuyPrice = sellCostMeanBuyPrice-570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-570
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-570
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-187
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 702, 570, 570
                    , 570, 570, 570, 570, 570, 187)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-702, netSellCostBuyPrice = netSellCostBuyPrice-570
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-570
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-570
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-570
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-570
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-570
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-570
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-187;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 137416 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 137416 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(9360,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-09-26 14:20:41', '066f551994dc37', '9360', '-404.00', '18', '0', '1', '422', '422', '0', '422', '1', '2024-09-26 14:20:41', '', '2', '0', 'ندي بدوي W689', '2', '1', '3', '83', 'ندي بدوي W689', '3', '137416', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','13198','0','0000-00-00','0','-1','0000-00-00','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '18', userid = '2' WHERE clientid = '9360';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9360','-404.00','422','0','اضافة فاتورة مبيعات (معدله)','143376', '18', '2024-11-05 22:27:49', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '422', '0', null, '0', null, null,'', '0','1','1','702','1','2024-09-26 14:20:41','0','0');
UPDATE client SET  inUse = 0 where clientid = 9360;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33613;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','06673', '143376', '5', '15166', '1', '400', '400', '0', '', '1', '2024-11-05 22:27:49', '15166', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33613-1,','0','0','0','0','400','400','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 159, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 524177;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15166, '2024-11-05', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 350, 159, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+159
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 400, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 350, 159, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+400, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+159
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-05 22:27:49' WHERE storedetailid = '15165';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15166', '1', '1', '1', '143376', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '9', '2', '2024-11-05 22:27:49','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143376', '9', '2015', '1', '15', '15', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:27:49', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','0','0','0','0','15','15','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143376', '17', '10291', '1', '7', '7', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:27:49', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','0','0','0','0','7','7','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 422, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 159, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+422, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+159
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9360, '2024-11-05', 422, 350, 350
                    , 350, 350, 350, 350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,350, 159, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+422, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+159
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 422, 350, 350
                    , 350, 350, 350, 350, 350, 159)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+422, netSellCostBuyPrice = netSellCostBuyPrice+350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+159;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 137416 and newid=143376 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:57:50";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:27:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:27:50', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143376');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:57:58";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:27:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:27:58', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:58:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:28:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:28:25', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9360
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9360,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9360','18.00','18','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 22:28:25', '2', 'clientDeficitController.php', '', '18', '0', null, '0', null, null,'', '0','1','1','18','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '9360';
UPDATE client SET  inUse = 0 where clientid = 9360;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9360 ,id=236069
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:58:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:28:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:28:25', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:58:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:28:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:28:27', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:58:37";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:28:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:28:37', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:58:51";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:28:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:28:51', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 18:58:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:28:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:28:57', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=137510');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:00:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:30:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:30:24', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:00:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:30:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:30:46', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:00:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:30:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:30:56', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=137510&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 137510
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 137510;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 22:30:56', userid = '9',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '137510';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33578;
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 238.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 238.00
        
                where sellbilldetailid = 502550;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15149, '2024-11-05', 290, 235, 235
                    , 238, 235, 238, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-290, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-238
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-238
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 235, 235
                    , 238, 235, 238, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-290, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-238
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-238
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2024-11-05 22:30:56' WHERE storedetailid = '15148';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15149', '1', '1', '0', '137510', 'حذف فاتورة مبيعات', 'sellbillController.php', '9', '10', '2', '2024-11-05 22:30:56','0','0');
CALL clientInUse(850,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '850';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('850','293.00','293.00','1','حذف فاتورة مبيعات','137510', '0', '2024-11-05 22:30:56', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '293', '0', null, '0', null, null,'', '0','1','1','293','1','2024-09-26 18:37:07','0','0');
UPDATE client SET  inUse = 0 where clientid = 850;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 293, 235, 235
                    , 238, 235, 238, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-293, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-238
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-238
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (850, '2024-11-05', 293, 235, 235
                    , 238, 235, 238, 237.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-293, sellCostBuyPrice =sellCostBuyPrice-235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-235, sellCostMeanBuyPrice = sellCostMeanBuyPrice-238
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-238
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-237.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 293, 235, 235
                    , 238, 235, 238, 237.5, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-293, netSellCostBuyPrice = netSellCostBuyPrice-235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-235
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-238
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-235
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-238
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-237.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 137510
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:00:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:30:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:30:57', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:00:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:30:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:30:59', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:02:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:32:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:32:55', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:03:41";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:33:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:33:41', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:04:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:34:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:34:14', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=136841');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:04:31";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:34:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:34:31', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 136841 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 136841 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 136841;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 22:34:31', userid = '75',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '136841';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-2 where id = 33638;
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 500014;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15186, '2024-11-05', 580, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-580, sellCostBuyPrice =sellCostBuyPrice-480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-480, sellCostMeanBuyPrice = sellCostMeanBuyPrice-480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-2
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 580, 480, 480
                    , 480, 480, 480, 480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-580, sellCostBuyPrice =sellCostBuyPrice-480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-480, sellCostMeanBuyPrice = sellCostMeanBuyPrice-480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '15185';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15186', '1', '2', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '4', '2', '2024-09-23 12:45:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33131;
UPDATE sellbilldetail SET  lastbuyprice = 255.00 , meanbuyprice = 255.00, lastbuyprice_withDiscount = 255.00, meanbuyprice_withDiscount = 255.00
        
                where sellbilldetailid = 500015;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14973, '2024-11-05', 310, 255, 255
                    , 255, 255, 255, 255
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-310, sellCostBuyPrice =sellCostBuyPrice-255
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-255, sellCostMeanBuyPrice = sellCostMeanBuyPrice-255
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-255, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-255
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-255
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 255, 255
                    , 255, 255, 255, 255
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-310, sellCostBuyPrice =sellCostBuyPrice-255
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-255, sellCostMeanBuyPrice = sellCostMeanBuyPrice-255
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-255, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-255
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-255
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '14972';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14973', '1', '1', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '2', '2024-09-23 12:45:33','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        
                where sellbilldetailid = 500016;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12315, '2024-11-05', 150, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-150, sellCostBuyPrice =sellCostBuyPrice-170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-170, sellCostMeanBuyPrice = sellCostMeanBuyPrice-170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-150, sellCostBuyPrice =sellCostBuyPrice-170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-170, sellCostMeanBuyPrice = sellCostMeanBuyPrice-170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '-2', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '12314';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12315', '1', '1', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-3', '-2', '2', '2024-09-23 12:45:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 30085;
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        
                where sellbilldetailid = 500017;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13482, '2024-11-05', 225, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-225, sellCostBuyPrice =sellCostBuyPrice-175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-175, sellCostMeanBuyPrice = sellCostMeanBuyPrice-175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 225, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-225, sellCostBuyPrice =sellCostBuyPrice-175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-175, sellCostMeanBuyPrice = sellCostMeanBuyPrice-175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '13481';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13482', '1', '1', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-1', '0', '2', '2024-09-23 12:45:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33230;
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 500018;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14600, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140.83
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-140, sellCostMeanBuyPrice = sellCostMeanBuyPrice-140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-140.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-140
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140.83
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-140, sellCostMeanBuyPrice = sellCostMeanBuyPrice-140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-140.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-140
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '14599';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14600', '1', '1', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '14', '15', '2', '2024-09-23 12:45:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33360;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 269.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 269.00
        
                where sellbilldetailid = 500019;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14395, '2024-11-05', 330, 270, 270
                    , 269, 270, 269, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 270, 270
                    , 269, 270, 269, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '14394';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14395', '1', '1', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '9', '2', '2024-09-23 12:45:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33424;
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        
                where sellbilldetailid = 500020;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14977, '2024-11-05', 190, 140, 140
                    , 141, 140, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-140, sellCostMeanBuyPrice = sellCostMeanBuyPrice-141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 141, 140, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-140, sellCostMeanBuyPrice = sellCostMeanBuyPrice-141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '14976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14977', '1', '1', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '9', '2', '2024-09-23 12:45:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33291;
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 500021;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15065, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '16', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '15064';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15065', '1', '1', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '16', '2', '2024-09-23 12:45:33','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 33633;
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        
                where sellbilldetailid = 500022;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15181, '2024-11-05', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-185, sellCostMeanBuyPrice = sellCostMeanBuyPrice-185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-240, sellCostBuyPrice =sellCostBuyPrice-185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-185, sellCostMeanBuyPrice = sellCostMeanBuyPrice-185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '15180';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15181', '1', '1', '0', '136841', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '2', '2024-09-23 12:45:33','0','0');
CALL clientInUse(7349,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-2458', userid = '2' WHERE clientid = '7349';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7349','-3.00','2455.00','1','تعديل فاتورة مبيعات','136841', '-2458', '2024-09-23 12:45:33', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '2455', '0', null, '0', null, null,'', '0','1','1','2455','1','2024-09-23 12:45:33','0','0');
UPDATE client SET  inUse = 0 where clientid = 7349;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2455, 1965, 1965
                    , 1965, 1965, 1965, 1966.83
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2455, sellCostBuyPrice =sellCostBuyPrice-1965
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1965, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1965
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1965, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1965
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1966.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-140
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7349, '2024-11-05', 2455, 1965, 1965
                    , 1965, 1965, 1965, 1966.83
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2455, sellCostBuyPrice =sellCostBuyPrice-1965
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1965, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1965
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1965, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1965
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1966.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-140
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2455, 1965, 1965
                    , 1965, 1965, 1965, 1966.83, 140, 140)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-2455, netSellCostBuyPrice = netSellCostBuyPrice-1965
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1965
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1965
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1965
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1965
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1966.83
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-140;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 136841 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 136841 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(7349,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-09-23 12:45:33', '066f146cda3670', '7349', '-2458.00', '-293', '0', '1', '2165', '2165', '0', '2165', '1', '2024-09-23 12:45:33', '', '2', '0', 'نهي عزت الوادي الجديد Y349', '2', '1', '3', '80', 'نهي عزت الوادي الجديد Y349', '11', '136841', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','13183','0','0000-00-00','0','-1','0000-00-00','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '-293', userid = '2' WHERE clientid = '7349';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7349','-2458.00','2165','0','اضافة فاتورة مبيعات (معدله)','143377', '-293', '2024-11-05 22:34:31', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '2165', '0', null, '0', null, null,'', '0','1','1','2455','1','2024-09-23 12:45:33','0','0');
UPDATE client SET  inUse = 0 where clientid = 7349;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33638;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','R3141', '143377', '1', '15186', '1', '290', '290', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:34:31', '15186', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33638-1,','0','0','0','0','290','290','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        
                where sellbilldetailid = 524180;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15186, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 290, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '15185';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15186', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '2', '2024-11-05 22:34:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('255','06577', '143377', '5', '14973', '1', '310', '310', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:34:31', '14973', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33131-1,','0','0','0','0','310','310','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 255.00 , meanbuyprice = 255.00, lastbuyprice_withDiscount = 255.00, meanbuyprice_withDiscount = 255.00
        
                where sellbilldetailid = 524181;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14973, '2024-11-05', 310, 255, 255
                    , 255, 255, 255, 255
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+255
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+255, sellCostMeanBuyPrice = sellCostMeanBuyPrice+255
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+255, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+255
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+255
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 310, 255, 255
                    , 255, 255, 255, 255
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+255
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+255, sellCostMeanBuyPrice = sellCostMeanBuyPrice+255
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+255, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+255
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+255
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '14972';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14973', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '4', '2', '2024-11-05 22:34:31','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('170','S1129', '143377', '3', '12315', '1', '150', '150', '0', '', '1', '2024-11-05 22:34:31', '12315', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','0','0','0','0','150','150','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 170.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 170.00, meanbuyprice_withDiscount = 170.00
        
                where sellbilldetailid = 524182;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12315, '2024-11-05', 150, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 150, 170, 170
                    , 170, 170, 170, 170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-3', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '12314';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12315', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '-2', '-3', '2', '2024-11-05 22:34:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30085;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('175','43479', '143377', '5', '13482', '1', '225', '225', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:34:31', '13482', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30085-1,','0','0','0','0','225','225','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 175.00, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 175.00
        
                where sellbilldetailid = 524183;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13482, '2024-11-05', 225, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 225, 175, 175
                    , 175, 175, 175, 175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-1', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '13481';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13482', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '0', '-1', '2', '2024-11-05 22:34:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33230;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06419', '143377', '5', '14600', '1', '190', '190', '0', '', '1', '2024-11-05 22:34:31', '14600', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33230-1,','0','0','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 524184;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14600, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140.83
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 140, 140, 140, 140.83
                    , 0, 0, 0, 0
                    , 0, 0, 0, 140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+140.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '14599';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14600', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '14', '2', '2024-11-05 22:34:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33360;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','R2920', '143377', '1', '14395', '1', '330', '330', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:34:31', '14395', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33360-1,','0','0','0','0','330','330','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 269.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 269.00
        
                where sellbilldetailid = 524185;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14395, '2024-11-05', 330, 270, 270
                    , 269, 270, 269, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 270, 270
                    , 269, 270, 269, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+269
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '14394';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14395', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '8', '2', '2024-11-05 22:34:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33424;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','06567', '143377', '5', '14977', '1', '190', '190', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:34:31', '14977', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33424-1,','0','0','0','0','190','190','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 141.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 141.00
        
                where sellbilldetailid = 524186;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14977, '2024-11-05', 190, 140, 140
                    , 141, 140, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 190, 140, 140
                    , 141, 140, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2024-11-05 22:34:31' WHERE storedetailid = '14976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14977', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '8', '2', '2024-11-05 22:34:31','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33291;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('150','06605', '143377', '5', '15065', '1', '200', '200', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:34:31', '15065', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33291-1,','0','0','0','0','200','200','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
        
                where sellbilldetailid = 524187;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15065, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 200, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2024-11-05 22:34:32' WHERE storedetailid = '15064';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15065', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '16', '15', '2', '2024-11-05 22:34:32','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 33633;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('185','06682', '143377', '5', '15181', '1', '240', '240', '0', '', '1', '2024-11-05 22:34:32', '15181', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','33633-1,','0','0','0','0','240','240','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 185.00
        
                where sellbilldetailid = 524188;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (15181, '2024-11-05', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 240, 185, 185
                    , 185, 185, 185, 185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+240, sellCostBuyPrice =sellCostBuyPrice+185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 22:34:32' WHERE storedetailid = '15180';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15181', '1', '1', '1', '143377', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '4', '2', '2024-11-05 22:34:32','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143377', '17', '10291', '1', '25', '25', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:34:32', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','0','0','0','0','25','25','0','','0','0.00','0','0','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','50235', '143377', '9', '2015', '1', '15', '15', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 22:34:32', '2015', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','','0','0','0','0','15','15','0','','0','0.00','0','0','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 2165, 1725, 1725
                    , 1725, 1725, 1725, 1726.83
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2165, sellCostBuyPrice =sellCostBuyPrice+1725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1726.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7349, '2024-11-05', 2165, 1725, 1725
                    , 1725, 1725, 1725, 1726.83
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,140, 140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2165, sellCostBuyPrice =sellCostBuyPrice+1725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1726.83
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2165, 1725, 1725
                    , 1725, 1725, 1725, 1726.83, 140, 140)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2165, netSellCostBuyPrice = netSellCostBuyPrice+1725
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1725
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1725
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1725
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1725
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1726.83
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+140;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 136841 and newid=143377 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:04:32";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:34:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:34:32', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143377');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:04:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:34:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:34:44', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:10:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:40:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:40:56', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:11:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:41:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:41:08', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:13:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:43:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:43:27', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =9666
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9666,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9666','293.00','293','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 22:43:27', '2', 'clientDeficitController.php', '', '293', '0', null, '0', null, null,'', '0','1','1','293','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '9666';
UPDATE client SET  inUse = 0 where clientid = 9666;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =9666 ,id=236073
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:13:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:43:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:43:28', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:13:29";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:43:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:43:29', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:16:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:46:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:46:35', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:17:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:47:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:47:06', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=141891');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:17:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:47:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:47:21', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:17:39";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:47:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:47:39', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:17:48";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:47:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:47:48', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=137303');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:20:37";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:50:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 22:50:37', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:21:00";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:51:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 22:51:00', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'دعاية', '', '6015', '2024-11-05', '2', '0','-1','2','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '245768.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('251783.50','6015', '1', '2', 'إضافة مصروف', '24301', '245768.5', '2024-11-05 22:51:00', '2',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'دعاية', expensesdetails = '', expensesValue = '6015.00', expensesdate = '2024-11-05', userid = '2', conditions = '0',saveid = '2' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24301';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:21:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:51:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 22:51:01', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:21:03";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:51:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 22:51:03', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:21:05";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:51:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 22:51:05', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:21:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:51:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 22:51:21', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=add');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment,currencyId,conversionFactor,conversionFactorFrom,conversionFactorTo,transfermoneyvalueInCurrency) VALUES ('2','1', '4000', '2024-11-05', '2', '0', '0','','1','1','0','0','4000');
UPDATE save SET  savecurrentvalue = '241768.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('245768.50','4000', '1', '2', 'تحويل امول الى الخزنة  [ نقدي ] ', '3311', '241768.5', '2024-11-05 22:51:21', '2',  'transfermoneyController.php','0','','0');
UPDATE save SET  savecurrentvalue = '40490',  userid = '2' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36490.00','4000', '0', '1', 'تحويل امول من الخزنة  [ فودافون كاش ] ', '3311', '40490', '2024-11-05 22:51:21', '2',  'transfermoneyController.php','0','','0');
UPDATE transfermoney SET saveidfrom = '2', saveidto = '1', transfermoneyvalue = '4000.00', transfermoneydate = '2024-11-05', userid = '2', conditions = '0' , dailyentryid = '0' , comment = '',currencyId='1',conversionFactor='1',conversionFactorFrom='1',conversionFactorTo='1',transfermoneyvalueInCurrency='4000' WHERE transfermoneyid = '3311';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:21:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:51:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 22:51:21', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:21:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:51:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 22:51:23', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:21:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:51:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:51:30', '2', 'addsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:23:12";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:53:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:53:12', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:23:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:53:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:53:24', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:23:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:53:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:53:33', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=141891&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 141891
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 141891;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 22:53:34', userid = '75',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '141891';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 34386;
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 226.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 226.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 5, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 518697;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14842, '2024-11-05', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-280, sellCostBuyPrice =sellCostBuyPrice-225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-225, sellCostMeanBuyPrice = sellCostMeanBuyPrice-226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 280, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-280, sellCostBuyPrice =sellCostBuyPrice-225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-225, sellCostMeanBuyPrice = sellCostMeanBuyPrice-226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '32', userid = '2', storedetaildate = '2024-11-05 22:53:34' WHERE storedetailid = '14841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14842', '1', '1', '0', '141891', 'حذف فاتورة مبيعات', 'sellbillController.php', '31', '32', '2', '2024-11-05 22:53:34','0','0');
CALL clientInUse(7956,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '7956';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7956','283.00','283.00','1','حذف فاتورة مبيعات','141891', '0', '2024-11-05 22:53:34', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '283', '0', null, '0', null, null,'', '0','1','1','283','1','2024-10-26 10:56:14','0','0');
UPDATE client SET  inUse = 0 where clientid = 7956;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 283, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-283, sellCostBuyPrice =sellCostBuyPrice-225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-225, sellCostMeanBuyPrice = sellCostMeanBuyPrice-226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7956, '2024-11-05', 283, 225, 225
                    , 226, 225, 226, 225.24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-283, sellCostBuyPrice =sellCostBuyPrice-225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-225, sellCostMeanBuyPrice = sellCostMeanBuyPrice-226
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-226
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-225.24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 283, 225, 225
                    , 226, 225, 226, 225.24, 225, 5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-283, netSellCostBuyPrice = netSellCostBuyPrice-225
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-225
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-226
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-225
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-226
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-225.24
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-225
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 141891
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:23:34";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:53:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:53:34', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:23:36";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:53:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:53:36', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:23:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:53:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:53:40', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:23:51";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:53:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:53:51', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:24:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:54:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:54:14', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:24:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:54:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:54:22', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=141605');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:24:29";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:54:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:54:29', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:24:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:54:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:54:44', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:25:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:55:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:55:59', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:26:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:56:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:56:06', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=142733');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:27:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:57:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 22:57:42', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:28:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:58:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 22:58:01', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236075
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1516,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '18' , clientdate = '2024-11-05 22:58:01', userid = '2' WHERE clientid = '1516';
UPDATE client SET  inUse = 0 where clientid = 1516;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1516','268.00','250','1','ايصال تحصيل (( قبض من عميل ))','236075', '18', '2024-11-05 22:57:42', '2', 'clientPayedDeptController.php', '   ', '250', '0', null, '0', null, null,'', '-1','1','1','250','1','','852','0');
UPDATE save SET  savecurrentvalue = '242018.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('241768.50','250', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236075', '242018.5', '2024-11-05 22:58:01', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ام كارن البساتين 58', 'ام كارن البساتين 58', 'ام كارن البساتين 58', 'ام كارن البساتين 58', '58', '0', '18.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 22:58:01');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '250', '250', '2024-11-05', '2', '0', '0', '2024-11-05 22:58:01','اضافة ايصال سداد للعميل ام كارن البساتين 58','1','0','0','0','236075','clientPayedDeptController.php?do=show&id=236075');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119005', '-1', '250', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '250', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119005', '11244', '250', '','0');
UPDATE accountstree SET name = 'ام كارن البساتين 58', customName = 'ام كارن البساتين 58', customNameEn = 'ام كارن البساتين 58', nameEn = 'ام كارن البساتين 58', parent = '58', accountNature = '0', theValue = '-232', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 22:58:01' WHERE id = '11244';
UPDATE clientdebtchange SET clientid = '1516', clientdebtchangebefore = '268.000', clientdebtchangeamount = '250.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236075', clientdebtchangeafter = '18.000', clientdebtchangedate = '2024-11-05 22:57:42', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '250.00',discount='', reciptid='0', dailyentryid = '119005',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='250',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236075';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236075 -clientdebtchangeId = 236075
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:28:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:58:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 22:58:02', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:28:11";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:58:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:58:11', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:28:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:58:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:58:28', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =1516
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(1516,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('1516','18.00','18','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 22:58:28', '2', 'clientDeficitController.php', '', '18', '0', null, '0', null, null,'', '0','1','1','18','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '1516';
UPDATE client SET  inUse = 0 where clientid = 1516;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =1516 ,id=236076
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:28:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:58:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:58:28', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:28:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:58:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 22:58:30', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:28:40";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:58:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 22:58:40', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:28:50";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 22:58:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 22:58:50', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143226');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:30:19";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:00:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:00:19', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:30:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:00:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:00:27', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=127250');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:32:08";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:02:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:02:08', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:32:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:02:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:02:25', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:32:45";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:02:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:02:45', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =7063
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7063,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7063','-180.00','180','0','تسوية عجز عميل بالزيادة','-1', '0', '2024-11-05 23:02:45', '2', 'clientDeficitController.php', '', '180', '0', null, '0', null, null,'', '0','1','1','180','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '7063';
UPDATE client SET  inUse = 0 where clientid = 7063;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =7063 ,id=236077
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:32:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:02:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:02:46', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:32:48";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:02:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:02:48', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:33:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:03:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:03:02', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:33:22";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:03:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:03:22', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =5320
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5320,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5320','165.00','165','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 23:03:22', '2', 'clientDeficitController.php', 'ف حساب تاني', '165', '0', null, '0', null, null,'', '0','1','1','165','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '5320';
UPDATE client SET  inUse = 0 where clientid = 5320;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =5320 ,id=236078
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:33:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:03:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:03:23', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:33:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:03:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:03:25', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:35:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:05:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:05:35', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:35:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:05:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:05:56', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236079
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3564,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 23:05:56', userid = '2' WHERE clientid = '3564';
UPDATE client SET  inUse = 0 where clientid = 3564;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3564','606.00','606','1','ايصال تحصيل (( قبض من عميل ))','236079', '0', '2024-11-05 23:05:35', '2', 'clientPayedDeptController.php', '   ', '606', '0', null, '0', null, null,'', '-1','1','1','606','1','','853','0');
UPDATE save SET  savecurrentvalue = '242624.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('242018.50','606', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236079', '242624.5', '2024-11-05 23:05:56', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '606', '606', '2024-11-05', '2', '0', '0', '2024-11-05 23:05:56','اضافة ايصال سداد للعميل شيماء محمد طنطا','1','0','0','0','236079','clientPayedDeptController.php?do=show&id=236079');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119006', '-1', '606', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '606', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119006', '-1', '606', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-606', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3564', clientdebtchangebefore = '606.000', clientdebtchangeamount = '606.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236079', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 23:05:35', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '606.00',discount='', reciptid='0', dailyentryid = '119006',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='606',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236079';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236079 -clientdebtchangeId = 236079
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:35:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:05:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:05:57', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:37:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:07:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:07:54', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:38:07";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:08:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:08:07', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=138877');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:38:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:08:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:08:42', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236080
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(31,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '37' , clientdate = '2024-11-05 23:08:42', userid = '2' WHERE clientid = '31';
UPDATE client SET  inUse = 0 where clientid = 31;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('31','637.00','600','1','ايصال تحصيل (( قبض من عميل ))','236080', '37', '2024-11-05 23:05:57', '2', 'clientPayedDeptController.php', '   ', '600', '0', null, '0', null, null,'', '-1','1','1','600','1','','854','0');
UPDATE save SET  savecurrentvalue = '243224.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('242624.50','600', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236080', '243224.5', '2024-11-05 23:08:42', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '600', '600', '2024-11-05', '2', '0', '0', '2024-11-05 23:08:42','اضافة ايصال سداد للعميل نجوي بشرى y17','1','0','0','0','236080','clientPayedDeptController.php?do=show&id=236080');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119007', '-1', '600', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '600', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119007', '-1', '600', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-600', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '31', clientdebtchangebefore = '637.000', clientdebtchangeamount = '600.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236080', clientdebtchangeafter = '37.000', clientdebtchangedate = '2024-11-05 23:05:57', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '600.00',discount='', reciptid='0', dailyentryid = '119007',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='600',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236080';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236080 -clientdebtchangeId = 236080
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:38:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:08:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:08:42', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:38:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:08:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:08:44', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:38:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:08:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:08:57', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =31
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(31,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('31','37.00','37','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 23:08:57', '2', 'clientDeficitController.php', '', '37', '0', null, '0', null, null,'', '0','1','1','37','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '31';
UPDATE client SET  inUse = 0 where clientid = 31;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =31 ,id=236081
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:38:58";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:08:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:08:58', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:38:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:08:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:08:59', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:40:29";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:10:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:10:29', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:40:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:10:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:10:35', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=136354');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:42:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:12:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:12:01', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:42:26";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:12:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:12:26', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:42:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:12:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:12:44', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add - with clientid =4458
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4458,@clientdebt,@clientname,@treeIdis);
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('4458','159.00','159','1','تسوية عجز عميل بالخصم','-1', '0', '2024-11-05 23:12:44', '2', 'clientDeficitController.php', '', '159', '0', null, '0', null, null,'', '0','1','1','159','1','','0','0');
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05', userid = '2' WHERE clientid = '4458';
UPDATE client SET  inUse = 0 where clientid = 4458;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientDeficitController add end- with clientid =4458 ,id=236082
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:42:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:12:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:12:44', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:42:46";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:12:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientDeficitController.php', '2024-11-05 23:12:46', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientDeficitController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:43:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:13:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:13:02', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:43:12";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:13:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:13:12', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:43:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:13:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:13:27', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=136533');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:44:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:14:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:14:54', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:45:07";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:15:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:15:07', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:45:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:15:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:15:27', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=136533&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 136533
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 136533;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 23:15:27', userid = '101',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '136533';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 31951;
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        
                where sellbilldetailid = 498969;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14365, '2024-11-05', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 330, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-330, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 23:15:27' WHERE storedetailid = '14364';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14365', '1', '1', '0', '136533', 'حذف فاتورة مبيعات', 'sellbillController.php', '0', '1', '2', '2024-11-05 23:15:27','0','0');
CALL clientInUse(5030,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '40', userid = '2' WHERE clientid = '5030';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('5030','389.00','349.00','1','حذف فاتورة مبيعات','136533', '40', '2024-11-05 23:15:27', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '349', '0', null, '0', null, null,'', '0','1','1','349','1','2024-09-20 19:21:42','0','0');
UPDATE client SET  inUse = 0 where clientid = 5030;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 349, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-349, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5030, '2024-11-05', 349, 270, 270
                    , 270, 270, 270, 270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-349, sellCostBuyPrice =sellCostBuyPrice-270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 349, 270, 270
                    , 270, 270, 270, 270, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-349, netSellCostBuyPrice = netSellCostBuyPrice-270
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-270
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-270
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-270
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-270
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-270
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 136533
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:45:28";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:15:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:15:28', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:45:29";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:15:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:15:29', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:45:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:15:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:15:44', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:46:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:16:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:16:02', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=134695');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:47:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:17:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:17:03', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:47:13";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:17:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:17:13', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:47:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:17:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:17:21', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=134701');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:49:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:19:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:19:21', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:49:36";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:19:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:19:36', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:49:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:19:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:19:55', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236084
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6935,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 23:19:55', userid = '2' WHERE clientid = '6935';
UPDATE client SET  inUse = 0 where clientid = 6935;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6935','170.00','170','1','ايصال تحصيل (( قبض من عميل ))','236084', '0', '2024-11-05 23:19:36', '2', 'clientPayedDeptController.php', '   ', '170', '0', null, '0', null, null,'', '-1','1','1','170','1','','855','0');
UPDATE save SET  savecurrentvalue = '243394.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('243224.50','170', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236084', '243394.5', '2024-11-05 23:19:55', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('روبي سعودي y83', 'روبي سعودي y83', 'روبي سعودي y83', 'روبي سعودي y83', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 23:19:55');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '170', '170', '2024-11-05', '2', '0', '0', '2024-11-05 23:19:55','اضافة ايصال سداد للعميل روبي سعودي y83','1','0','0','0','236084','clientPayedDeptController.php?do=show&id=236084');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119008', '-1', '170', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '170', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119008', '11245', '170', '','0');
UPDATE accountstree SET name = 'روبي سعودي y83', customName = 'روبي سعودي y83', customNameEn = 'روبي سعودي y83', nameEn = 'روبي سعودي y83', parent = '58', accountNature = '0', theValue = '-170', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 23:19:55' WHERE id = '11245';
UPDATE clientdebtchange SET clientid = '6935', clientdebtchangebefore = '170.000', clientdebtchangeamount = '170.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236084', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 23:19:36', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '170.00',discount='', reciptid='0', dailyentryid = '119008',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='170',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236084';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236084 -clientdebtchangeId = 236084
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:49:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:19:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:19:56', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:50:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:20:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:20:56', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236085
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9565,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 23:20:56', userid = '2' WHERE clientid = '9565';
UPDATE client SET  inUse = 0 where clientid = 9565;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9565','200.00','200','1','ايصال تحصيل (( قبض من عميل ))','236085', '0', '2024-11-05 23:19:56', '2', 'clientPayedDeptController.php', '   ', '200', '0', null, '0', null, null,'', '-1','1','1','200','1','','856','0');
UPDATE save SET  savecurrentvalue = '243594.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('243394.50','200', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236085', '243594.5', '2024-11-05 23:20:56', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES (' هبه احمد', ' هبه احمد', ' هبه احمد', ' هبه احمد', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 23:20:56');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '200', '200', '2024-11-05', '2', '0', '0', '2024-11-05 23:20:56','اضافة ايصال سداد للعميل  هبه احمد','1','0','0','0','236085','clientPayedDeptController.php?do=show&id=236085');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119009', '-1', '200', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '200', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119009', '11246', '200', '','0');
UPDATE accountstree SET name = ' هبه احمد', customName = ' هبه احمد', customNameEn = ' هبه احمد', nameEn = ' هبه احمد', parent = '58', accountNature = '0', theValue = '-200', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 23:20:56' WHERE id = '11246';
UPDATE clientdebtchange SET clientid = '9565', clientdebtchangebefore = '200.000', clientdebtchangeamount = '200.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236085', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 23:19:56', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '200.00',discount='', reciptid='0', dailyentryid = '119009',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='200',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236085';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236085 -clientdebtchangeId = 236085
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:50:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:20:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:20:57', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:51:43";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:21:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:21:43', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:51:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:21:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:21:57', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=132022');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:53:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:23:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:23:27', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:53:37";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:23:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:23:37', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=131994');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:54:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:24:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:24:01', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=143270');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:55:07";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:25:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:25:07', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:55:54";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:25:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:25:54', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=121235');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:56:01";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:26:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:26:01', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:56:12";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:26:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:26:12', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:56:24";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:26:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:26:25', '2', 'delete', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=delete&sellbillid=121235&action=0');

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 121235
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 121235;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 23:26:25', userid = '75',delbyuserid = '2', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '121235';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 28984;
UPDATE sellbilldetail SET  lastbuyprice = 125.00 , meanbuyprice = 125.00, lastbuyprice_withDiscount = 125.00, meanbuyprice_withDiscount = 125.00
        
                where sellbilldetailid = 439455;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12921, '2024-11-05', 175, 125, 125
                    , 125, 125, 125, 125
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-175, sellCostBuyPrice =sellCostBuyPrice-125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 175, 125, 125
                    , 125, 125, 125, 125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-175, sellCostBuyPrice =sellCostBuyPrice-125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 23:26:25' WHERE storedetailid = '12920';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12921', '1', '1', '0', '121235', 'حذف فاتورة مبيعات', 'sellbillController.php', '0', '1', '2', '2024-11-05 23:26:25','0','0');
CALL clientInUse(7097,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '7097';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('7097','192.00','192.00','1','حذف فاتورة مبيعات','121235', '0', '2024-11-05 23:26:25', '2', 'sellbillController.php', 'حذف فاتورة مبيعات', '192', '0', null, '0', null, null,'', '0','1','1','192','1','2024-06-12 12:10:30','0','0');
UPDATE client SET  inUse = 0 where clientid = 7097;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 192, 125, 125
                    , 125, 125, 125, 125
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-192, sellCostBuyPrice =sellCostBuyPrice-125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7097, '2024-11-05', 192, 125, 125
                    , 125, 125, 125, 125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-192, sellCostBuyPrice =sellCostBuyPrice-125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 192, 125, 125
                    , 125, 125, 125, 125, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-192, netSellCostBuyPrice = netSellCostBuyPrice-125
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-125
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-125
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-125
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-125
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-125
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 121235
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:56:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:26:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:26:25', '2', 'sucess', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:56:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:26:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:26:27', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:57:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:27:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:27:21', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:57:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:27:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:27:27', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=129866');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:58:26";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:28:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:28:26', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:58:42";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:28:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:28:42', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:59:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:29:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:29:21', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=121351');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 19:59:59";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:29:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:29:59', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=126807');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:00:09";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:30:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:30:09', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=126833');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:01:53";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:31:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:31:53', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:02:15";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:32:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:32:15', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236087
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(9325,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 23:32:15', userid = '2' WHERE clientid = '9325';
UPDATE client SET  inUse = 0 where clientid = 9325;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9325','310.00','310','1','ايصال تحصيل (( قبض من عميل ))','236087', '0', '2024-11-05 23:31:53', '2', 'clientPayedDeptController.php', '   ', '310', '0', null, '0', null, null,'', '-1','1','1','310','1','','857','0');
UPDATE save SET  savecurrentvalue = '243904.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('243594.50','310', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236087', '243904.5', '2024-11-05 23:32:15', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نيره اكتوبر', 'نيره اكتوبر', 'نيره اكتوبر', 'نيره اكتوبر', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 23:32:16');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '310', '310', '2024-11-05', '2', '0', '0', '2024-11-05 23:32:16','اضافة ايصال سداد للعميل نيره اكتوبر','1','0','0','0','236087','clientPayedDeptController.php?do=show&id=236087');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119010', '-1', '310', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '310', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119010', '11247', '310', '','0');
UPDATE accountstree SET name = 'نيره اكتوبر', customName = 'نيره اكتوبر', customNameEn = 'نيره اكتوبر', nameEn = 'نيره اكتوبر', parent = '58', accountNature = '0', theValue = '-310', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 23:32:16' WHERE id = '11247';
UPDATE clientdebtchange SET clientid = '9325', clientdebtchangebefore = '310.000', clientdebtchangeamount = '310.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236087', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 23:31:53', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '310.00',discount='', reciptid='0', dailyentryid = '119010',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='310',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236087';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236087 -clientdebtchangeId = 236087
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:02:16";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:32:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:32:16', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:04:21";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:34:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:34:21', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:04:35";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:34:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:34:35', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:05:17";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:35:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:35:17', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=118990');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:06:44";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:36:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:36:44', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:06:55";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:36:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:36:55', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=128377');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:10', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:17', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40390',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40490.00','100', '1', '1', 'إضافة مصروف', '24302', '40390', '2024-11-05 23:40:17', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24302';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:18', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:19', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:23";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:23", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:23', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:32', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ايمان', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40340',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40390.00','50', '1', '1', 'إضافة مصروف', '24303', '40340', '2024-11-05 23:40:32', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ايمان', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24303';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:32', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:34', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:35";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:35", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:35', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:48";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:48", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:48', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'لاحا', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40290',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40340.00','50', '1', '1', 'إضافة مصروف', '24304', '40290', '2024-11-05 23:40:48', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'لاحا', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24304';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:49', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:10:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:40:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:40:50', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:11:33";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:41:33", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:41:33', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'خشبه', '', '200', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '40090',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40290.00','200', '1', '1', 'إضافة مصروف', '24305', '40090', '2024-11-05 23:41:34', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'خشبه', expensesdetails = '', expensesValue = '200.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24305';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:11:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:41:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:41:34', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:11:36";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:41:36", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:41:36', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:11:40";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:41:40", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:41:40', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:11:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:41:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:41:55', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'ابراهيم', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '39990',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40090.00','100', '1', '1', 'إضافة مصروف', '24306', '39990', '2024-11-05 23:41:55', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'ابراهيم', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24306';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:11:55";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:41:55", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:41:55', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:11:57";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:41:57", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:41:57', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:42:00', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:10";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:10", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:42:10', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'يوسف لاحا', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '39890',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39990.00','100', '1', '1', 'إضافة مصروف', '24307', '39890', '2024-11-05 23:42:10', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'يوسف لاحا', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24307';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:11";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:11", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:42:11', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:12";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:12", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:42:12', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:34";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:34", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:42:34', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:46";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:46", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:42:46', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'فرق فاتورة ', '', '20', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '39870',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39890.00','20', '1', '1', 'إضافة مصروف', '24308', '39870', '2024-11-05 23:42:46', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'فرق فاتورة ', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24308';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:47";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:47", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:42:47', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:49";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:49", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:42:49', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:12:50";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:42:50", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 23:42:50', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:13:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:43:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 23:43:04', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:13:18";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:43:18", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 23:43:18', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:13:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:43:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:43:53', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:01";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:44:01", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:44:01', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'النون', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '39820',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39870.00','50', '1', '1', 'إضافة مصروف', '24309', '39820', '2024-11-05 23:44:01', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'النون', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24309';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:44:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:44:02', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:44:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:44:03', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:44:05", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:44:05', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:14";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:44:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:44:14', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:44:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:44:17', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'مستلزمات مكتب', '', '50', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '39770',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39820.00','50', '1', '1', 'إضافة مصروف', '24310', '39770', '2024-11-05 23:44:17', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'مستلزمات مكتب', expensesdetails = '', expensesValue = '50.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24310';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:17";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:44:17", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:44:17', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:19";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:44:19", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:44:19', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:44:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 23:44:20', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:14:27";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:44:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:44:28', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=127250');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:15:25";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:45:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:45:25', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=126942');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:15:50";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:45:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:45:50', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:02";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:46:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:46:03', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:15";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:46:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:46:15', '2', 'editsellBill', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=126942');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:46:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:46:22', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:29";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:46:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:46:29', '2', 'update', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=update');
BEGIN;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - with id = 126942 and  = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete start with id = 126942 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 126942;
UPDATE sellbill SET  sellbillsysdate = '2024-11-05 23:46:29', userid = '9',delbyuserid = '2', conditions = '1'  WHERE sellbillid = '126942';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-2 where id = 30083;
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 459671;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13481, '2024-11-05', 1110, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1110, sellCostBuyPrice =sellCostBuyPrice-990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-990, sellCostMeanBuyPrice = sellCostMeanBuyPrice-990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-2
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1110, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1110, sellCostBuyPrice =sellCostBuyPrice-990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-990, sellCostMeanBuyPrice = sellCostMeanBuyPrice-990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2024-11-05 23:46:29' WHERE storedetailid = '13480';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13481', '1', '2', '0', '126942', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '6', '2', '2024-07-30 19:21:41','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 30779;
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 459672;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13790, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-380, sellCostBuyPrice =sellCostBuyPrice-320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-380, sellCostBuyPrice =sellCostBuyPrice-320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2024-11-05 23:46:29' WHERE storedetailid = '13789';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13790', '1', '1', '0', '126942', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '2', '2024-07-30 19:21:41','0','0');
CALL clientInUse(9142,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-495', userid = '2' WHERE clientid = '9142';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9142','200.00','695.00','1','تعديل فاتورة مبيعات','126942', '-495', '2024-07-30 19:21:41', '2', 'sellbillController.php', 'تعديل فاتورة مبيعات', '1695', '0', null, '0', null, null,'', '0','1','1','695','1','2024-07-30 19:21:41','0','0');
UPDATE client SET  inUse = 0 where clientid = 9142;
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '38770',  userid = '2' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39770','1000', '1', '1', 'تعديل فاتورة مبيعات', '126942', '38770', '2024-11-05 23:46:29', '2',  'sellbillController.php','9142','','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1695, 1310, 1310
                    , 1310, 1310, 1310, 1310
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1695, sellCostBuyPrice =sellCostBuyPrice-1310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1310, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9142, '2024-11-05', 1695, 1310, 1310
                    , 1310, 1310, 1310, 1310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1695, sellCostBuyPrice =sellCostBuyPrice-1310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1310, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1695, 1310, 1310
                    , 1310, 1310, 1310, 1310, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-1695, netSellCostBuyPrice = netSellCostBuyPrice-1310
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1310
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1310
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1310
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1310
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1310
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-0;

-- ----------------------------------------------------------------------------------------------------
-- bill update start - delete end - with id = 126942 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 126942 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

COMMIT;
BEGIN;
CALL clientInUse(9142,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid) VALUES ('2024-07-30 19:21:41', '066a921251d04e', '9142', '-495.00', '0', '0', '1', '1495', '1495', '1000', '495', '1', '2024-07-30 19:21:41', '', '2', '0', 'اية خالد 12', '1', '1', '3', '73', 'اية خالد 12', '4', '126942', 'sellbillController', '0','','','','','-1','0','0','1000','0','0','0','0','0','0','0','11097','0','0000-00-00','0','-1','0000-00-00','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '9142';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('9142','-495.00','495','0','اضافة فاتورة مبيعات (معدله)','143378', '0', '2024-11-05 23:46:29', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '1495', '0', null, '0', null, null,'', '0','1','1','695','1','2024-07-30 19:21:41','0','0');
UPDATE client SET  inUse = 0 where clientid = 9142;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 30083;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('495','83631', '143378', '5', '13481', '2', '555', '1110', '0', '', '1', '2024-11-05 23:46:29', '13481', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30083-2,','0','0','0','0','555','1110','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 495.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        
                where sellbilldetailid = 524191;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13481, '2024-11-05', 1110, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1110, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 1110, 990, 990
                    , 990, 990, 990, 990
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1110, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+990, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+990
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+990
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2024-11-05 23:46:29' WHERE storedetailid = '13480';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13481', '1', '2', '1', '143378', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '4', '2', '2024-11-05 23:46:29','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 30779;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','06105', '143378', '5', '13790', '1', '380', '380', '0', '', '1', '2024-11-05 23:46:29', '13790', '0.00', '-1', '1','0','','','0','0','0','0','0','0','1','0','','30779-1,','0','0','0','0','380','380','0','','0','0.00','0','0','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        
                where sellbilldetailid = 524192;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13790, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2024-11-05', 380, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+380, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2024-11-05 23:46:29' WHERE storedetailid = '13789';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13790', '1', '1', '1', '143378', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '2', '2024-11-05 23:46:29','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','10291', '143378', '17', '10291', '1', '5', '5', '0', 'رقم الشاسيه	 : undefined <br/> رقم الموتور : undefined <br/> اللون : undefined', '1', '2024-11-05 23:46:29', '10291', '0.00', '1', '1','0','','','0','0','0','0','0','0','1','0','','','0','0','0','0','5','5','0','','0','0.00','0','0','0','0');
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '39770',  userid = '2' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('38770','1000', '0', '1', 'اضافة فاتورة مبيعات (معدله)', '143378', '39770', '2024-11-05 23:46:29', '2',  'sellbillController.php','9142','','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2024-11-05', 1495, 1310, 1310
                    , 1310, 1310, 1310, 1310
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1495, sellCostBuyPrice =sellCostBuyPrice+1310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9142, '2024-11-05', 1495, 1310, 1310
                    , 1310, 1310, 1310, 1310
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1495, sellCostBuyPrice =sellCostBuyPrice+1310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1495, 1310, 1310
                    , 1310, 1310, 1310, 1310, 0, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1495, netSellCostBuyPrice = netSellCostBuyPrice+1310
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1310
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1310
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1310
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1310
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1310
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+0
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 126942 and newid=143378 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:30";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:46:30", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:46:30', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=add');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:30";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:46:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:46:30', '2', 'editprint', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=editprint&id=143378');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId) VALUES ('1', 'كريم', '', '100', '2024-11-05', '9', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0');
UPDATE save SET  savecurrentvalue = '39670',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39770.00','100', '1', '1', 'إضافة مصروف', '24311', '39670', '2024-11-05 23:46:30', '9',  'expensesController.php','0','','0');
UPDATE expenses SET expensestypeid = '1', expensesname = 'كريم', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-11-05', userid = '9', conditions = '0',saveid = '1' , dailyentryid = '0', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0' WHERE expensesid = '24311';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:31";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:46:31", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:46:31', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:46:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:46:32', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:16:41";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:46:41", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 23:46:41', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:17:34";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:47:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:47:34', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:17:51";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:47:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:47:51', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:17:57";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:47:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:47:57', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=127159');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:18:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:48:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:48:04', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:18:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:48:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:48:23', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236090
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(8894,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 23:48:23', userid = '2' WHERE clientid = '8894';
UPDATE client SET  inUse = 0 where clientid = 8894;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('8894','350.00','350','1','ايصال تحصيل (( قبض من عميل ))','236090', '0', '2024-11-05 23:48:04', '2', 'clientPayedDeptController.php', '   ', '350', '0', null, '0', null, null,'', '-1','1','1','350','1','','858','0');
UPDATE save SET  savecurrentvalue = '244254.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('243904.50','350', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236090', '244254.5', '2024-11-05 23:48:23', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('دنيا شريف', 'دنيا شريف', 'دنيا شريف', 'دنيا شريف', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 23:48:23');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '350', '350', '2024-11-05', '2', '0', '0', '2024-11-05 23:48:23','اضافة ايصال سداد للعميل دنيا شريف','1','0','0','0','236090','clientPayedDeptController.php?do=show&id=236090');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119011', '-1', '350', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '350', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119011', '11248', '350', '','0');
UPDATE accountstree SET name = 'دنيا شريف', customName = 'دنيا شريف', customNameEn = 'دنيا شريف', nameEn = 'دنيا شريف', parent = '58', accountNature = '0', theValue = '-350', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 23:48:23' WHERE id = '11248';
UPDATE clientdebtchange SET clientid = '8894', clientdebtchangebefore = '350.000', clientdebtchangeamount = '350.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236090', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 23:48:04', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '350.00',discount='', reciptid='0', dailyentryid = '119011',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='350',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236090';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236090 -clientdebtchangeId = 236090
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:18:23";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:48:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:48:23', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:19:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:49:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 23:49:02', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:19:04";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:49:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:49:04', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:19:53";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:49:53", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 23:49:53', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:20:32";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:50:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:50:32', '2', 'add', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236091
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6670,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2024-11-05 23:50:32', userid = '2' WHERE clientid = '6670';
UPDATE client SET  inUse = 0 where clientid = 6670;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('6670','185.00','185','1','ايصال تحصيل (( قبض من عميل ))','236091', '0', '2024-11-05 23:48:24', '2', 'clientPayedDeptController.php', '   ', '185', '0', null, '0', null, null,'', '-1','1','1','185','1','','859','0');
UPDATE save SET  savecurrentvalue = '244439.5',  userid = '2' WHERE saveid = '2';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('244254.50','185', '0', '2', 'ايصال تحصيل (( قبض من عميل ))', '236091', '244439.5', '2024-11-05 23:50:32', '2',  'clientPayedDeptController.php','0','','0');
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ام موسي ', 'ام موسي ', 'ام موسي ', 'ام موسي ', '58', '0', '0.00', '0', '', '0', '0', '', '0', '3', '1', '', '2', '0', '2024-11-05 23:50:32');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '185', '185', '2024-11-05', '2', '0', '0', '2024-11-05 23:50:32','اضافة ايصال سداد للعميل ام موسي ','1','0','0','0','236091','clientPayedDeptController.php?do=show&id=236091');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119012', '-1', '185', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '185', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119012', '11249', '185', '','0');
UPDATE accountstree SET name = 'ام موسي ', customName = 'ام موسي ', customNameEn = 'ام موسي ', nameEn = 'ام موسي ', parent = '58', accountNature = '0', theValue = '-185', theOrder = '0', layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2024-11-05 23:50:32' WHERE id = '11249';
UPDATE clientdebtchange SET clientid = '6670', clientdebtchangebefore = '185.000', clientdebtchangeamount = '185.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236091', clientdebtchangeafter = '0.000', clientdebtchangedate = '2024-11-05 23:48:24', userid = '2', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '185.00',discount='', reciptid='0', dailyentryid = '119012',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='185',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236091';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236091 -clientdebtchangeId = 236091
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:20:33";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:50:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:50:33', '2', '', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:20:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:50:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:50:56', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:21:16";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:51:16", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 23:51:16', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:21:44";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:51:44", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2024-11-05 23:51:44', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/savedailyController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:22:51";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:52:51", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:52:51', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:23:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:53:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:53:20', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236092
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3677,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-15590' , clientdate = '2024-11-05 23:53:20', userid = '9' WHERE clientid = '3677';
UPDATE client SET  inUse = 0 where clientid = 3677;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3677','-14590.00','1000','1','ايصال تحصيل (( قبض من عميل ))','236092', '-15590', '2024-11-05 23:52:51', '9', 'clientPayedDeptController.php', '   ', '1000', '0', null, '0', null, null,'', '-1','1','1','1000','1','','860','0');
UPDATE save SET  savecurrentvalue = '40670',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('39670.00','1000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '236092', '40670', '2024-11-05 23:53:20', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1000', '1000', '2024-11-05', '9', '0', '0', '2024-11-05 23:53:20','اضافة ايصال سداد للعميل زيادة ','1','0','0','0','236092','clientPayedDeptController.php?do=show&id=236092');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119013', '-1', '1000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '1000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119013', '-1', '1000', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-1000', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3677', clientdebtchangebefore = '-14590.000', clientdebtchangeamount = '1000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236092', clientdebtchangeafter = '-15590.000', clientdebtchangedate = '2024-11-05 23:52:51', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1000.00',discount='', reciptid='0', dailyentryid = '119013',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1000',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236092';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236092 -clientdebtchangeId = 236092
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:23:20";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:53:20", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:53:21', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:23:22";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:53:22", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:53:22', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:24:38";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:54:38", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2024-11-05 23:54:38', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/expensesController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:25:03";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:55:03", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 23:55:03', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:25:32";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:55:32", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:55:32', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:25:43";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:55:43", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:55:43', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:25:56";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:55:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2024-11-05 23:55:56', '2', 'show', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientReportsController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:25:59";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:55:59", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:55:59', '9', 'add', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=add');

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =236093
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3677,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-15620' , clientdate = '2024-11-05 23:55:59', userid = '9' WHERE clientid = '3677';
UPDATE client SET  inUse = 0 where clientid = 3677;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments ) VALUES ('3677','-15590.00','30','1','ايصال تحصيل (( قبض من عميل ))','236093', '-15620', '2024-11-05 23:55:43', '9', 'clientPayedDeptController.php', '   ', '30', '0', null, '0', null, null,'', '-1','1','1','30','1','','861','0');
UPDATE save SET  savecurrentvalue = '40700',  userid = '9' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40670.00','30', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '236093', '40700', '2024-11-05 23:55:59', '9',  'clientPayedDeptController.php','0','','0');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30', '30', '2024-11-05', '9', '0', '0', '2024-11-05 23:56:00','اضافة ايصال سداد للعميل زيادة ','1','0','0','0','236093','clientPayedDeptController.php?do=show&id=236093');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119014', '-1', '30', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '30', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('119014', '-1', '30', '','0');
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '-30', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
UPDATE clientdebtchange SET clientid = '3677', clientdebtchangebefore = '-15590.000', clientdebtchangeamount = '30.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '236093', clientdebtchangeafter = '-15620.000', clientdebtchangedate = '2024-11-05 23:55:43', userid = '9', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '30.00',discount='', reciptid='0', dailyentryid = '119014',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='30',saveConversionFactor='1',totalpayments='0' WHERE clientdebtchangeid = '236093';
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add end - with modelid =236093 -clientdebtchangeId = 236093
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:26:00";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:56:00", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:56:00', '9', 'sucess', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=sucess');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:26:02";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:56:02", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2024-11-05 23:56:02', '9', 'show', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/clientPayedDeptController.php?do=show');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:26:04";
UPDATE user SET loginip = "192.168.1.158", lastactivetime = "2024-11-05 23:56:04", deviceType = "DESKTOP" WHERE userid = 9;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2024-11-05 23:56:04', '9', '', '192.168.1.158', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/transfermoneyController.php');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-11-05 20:26:06";
UPDATE user SET loginip = "192.168.1.10", lastactivetime = "2024-11-05 23:56:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2024-11-05 23:56:06', '2', 'showDetail', '192.168.1.10', '', 'DESKTOP','https://41.131.49.210/~newweb/erp/controllers/sellbillController.php?do=showDetail&sellbillid=122654');
UPDATE user SET loginip = "" WHERE userid = 2;
UPDATE user SET loginip = "" WHERE userid = 2;
